Newtonsoft JSON Deserialize

The Solution to Newtonsoft JSON Deserialize is

You can implement a class that holds the fields you have in your JSON

class MyData
    public string t;
    public bool a;
    public object[] data;
    public string[][] type;

and then use the generic version of DeserializeObject:

MyData tmp = JsonConvert.DeserializeObject<MyData>(json);
foreach (string typeStr in tmp.type[0])
    // Do something with typeStr

Documentation: Serializing and Deserializing JSON

~ Answered on 2013-06-11 07:41:15

Most Viewed Questions: