Json deserializing issue c# -
i want trying deserialize next facebook post response:
"data": [ { "id": "...", "from": { "category": "local business", "name": "...", "id": "..." }, "message": "...", "picture": "...", "likes": { "data": [ { "id": "...", "name": "..." }, { "id": "...", "name": "..." ] } } ]
post model class is:
public class post { public string id { get; set; } public from { get; set; } public string message { get; set; } public string image { get; set; } [jsonproperty("likes.data")] <===== why not working?? public list<like> likes { get; set; } }
like model class
public class { public string id { get; set; } public string name { get; set; } }
while deserializing json want map likes.data entries likes list. how can this??
you can utilize newtonsoft.json deserializing json.
newtonsoft.json.jsonconvert.deserializeobject("{\"data\": [...]")
c# json facebook
No comments:
Post a Comment