Converting a JSON.NET JObject's Properties/Tokens into Dictionary Keys

后端 未结 3 1981
醉话见心
醉话见心 2020-12-06 04:52

I\'m using JSON.NET to parse a JSON reponse from openexhangerates.org server side using .NET. The response contains a nested object (\"rates\") which has a long list of nume

3条回答
  •  被撕碎了的回忆
    2020-12-06 05:10

    If you're expecting the child object to have an object property(or field), it's better to use:

    Dictionary rates = parsed["rates"].ToObject>();
    

    Otherwise, it will throw an error.

提交回复
热议问题