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 PunhaniPosted Jul 19, 2016, 9:24 AM
If the above solution is helpful then,accept the answer.
TommyPosted Jul 19, 2016, 7:12 PM
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.
Ravi SangtaniPosted Jul 19, 2016, 3:12 AM
TommyPosted Jul 18, 2016, 8:33 AM
Suthish NairPosted Jul 18, 2016, 6:13 AM
TommyPosted Jul 18, 2016, 5:12 AM
Suthish NairPosted Jul 18, 2016, 2:52 AM
TommyPosted Jul 18, 2016, 2:22 AM
kalu singh raoPosted Jul 18, 2016, 2:01 AM
Hima BinduPosted Jul 18, 2016, 1:36 AM
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);