JSON.NET

JSON.net and Deserializing Anonymous Types

I had a situation where I had to deserialize a small chunk of JSON-formatted data and I didn’t want to create a class for it since it was a very specific use and I was confident there wasn’t a need to reuse it elsewhere in the application. If I did have a class defined for the JSON data, I could easily use JSON.NET’s JsonConvert.DeserializeObject method: 1: string myJson = "[{id: 10, typeID: 4},{id: 100, typeID: 3}]"; 2: MyObject obj = JsonConvert.DeserializeObje... 3: Console.WriteLine(obj[0].id); ......

«July»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789