Deserialize JSON with dynamic objects

后端 未结 4 947
梦毁少年i
梦毁少年i 2020-12-11 02:41

I have a JSON object that comes with a long list of area codes. Unfortunately each area code is the object name on a list in the Data object. How do I create a class that wi

4条回答
  •  既然无缘
    2020-12-11 02:43

    I don't know anything about RestSharp, but if you're using Newtonsoft on the server side, then you can just pass a JObject to your method. Then you can interrogate the object to see what type of object it really is and use JObject.ToObject() to convert it.

提交回复
热议问题