Hey guys,
I have JSON string:
{"results": {
"0001": [{
"type": "AA",
"Id": "420",
"service": false,
"description": "",
"imageUrl": "http://www.somelink.com/file.jpg",
"date": "1457608735000"
},
{
"type": "CC",
"Id": "114",
"service": true,
"description": "",
"imageUrl": "http://www.somelink.com/file.jpg",
"date": "1457611015000"
}]
}
}
"0001": [{
"type": "AA",
"Id": "420",
"service": false,
"description": "",
"imageUrl": "http://www.somelink.com/file.jpg",
"date": "1457608735000"
},
{
"type": "CC",
"Id": "114",
"service": true,
"description": "",
"imageUrl": "http://www.somelink.com/file.jpg",
"date": "1457611015000"
}]
}
}
In this example array 0001 will be dynamic id in numbers, it will be always random number. How can I deserialize this string into right order? I need to receive type, Id, service, description, imageUrl, date of the very last object (the one who's "type":"CC").
Please, somebody help. Thank you.


Rajeev PunhaniRank #551 · 4.4K reputationPosted Jul 19, 2016, 5:24 AM EDT
If the above solution is helpful then,accept the answer.
Hima BinduRank #4,292 · 353 reputationPosted Jul 17, 2016, 9:36 PM EDT
With latest json you can use dynamic keyword to get this done
dynamic d = JObject.Parse("{id:114,type:'string', array: [1,2,3,4,5,6]}"); Console.WriteLine(d.id); Console.WriteLine(d.type); Console.WriteLine(d.array.Count);
kalu singh raoRank #884 · 2.4K reputationPosted Jul 17, 2016, 10:01 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Jul 18, 2016, 2:13 AM EDT
Ravi SangtaniRank #1,947 · 751 reputationPosted Jul 18, 2016, 11:12 PM EDT
Tommy103 reputationPosted Jul 19, 2016, 3:12 PM EDT
I'd like to thank you from the bottom of my heart to you all whotried to help me.
Rajeev Punhani- you really are a star of this one. Thank you so much, your code is exactly what I've been looking for.
Tommy103 reputationPosted Jul 17, 2016, 10:22 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Jul 17, 2016, 10:52 PM EDT
Tommy103 reputationPosted Jul 18, 2016, 1:12 AM EDT
Tommy103 reputationPosted Jul 18, 2016, 4:33 AM EDT