C# .net how to deserialize complex object of JSON -
i have json string , need deserialize it.
nothing worked me.. json
{ "response": [ { "loopa": "81ed1a646s894309ca1746fd6b57e5bb46ec18d1faff", "drupa": "d4492c3cce7d6f839b2basd2f08577f89a27b4ff", "images": [ { "report": { "nemo": "unknown" }, "status": "rock", "id": "7e6ffe36e-8789e-4c235-87044-56378f08m30df", "market": 1 }, { "report": { "nemo": "unknown" }, "status": "rock", "id": "e50e99df3-59563-45673-afj79e-e3f47504sb55e2", "market": 1 } ] } ] }
i have example of classes don't have use classes, don't mind using other classes. these classes:
public class report { public string nemo { get; set; } } public class image { public report report { get; set; } public string status { get; set; } public string id { get; set; } public int market { get; set; } } public class response { public string loopa { get; set; } public string drupa{ get; set; } public image[] images { get; set; } } public class rootobject { public response[] response { get; set; } }
i want mention have newtonsoft.json can use functions there.
how can this? thanks.
i using in code , it's working fine
below piece of code need write
using system.web.script.serialization; javascriptserializer ojs = new javascriptserializer(); rootobject orootobject = new rootobject(); orootobject = ojs.deserialize<rootobject>(your json string);
Comments
Post a Comment