Your JSON is formatted wrong for one. It should look more like below.
Option 1:
{ "Classes": [
{"value": "sdasd", "type": "int"},
{"value": "sds", "type": "boolean"},
{"value": "sd", "type": "string"},
{"value": "sdds", "type": "datetime"}
]}
This is an object array in JSON. If this is the newline delimited JSON, honestly, I have no idea about that.
Next you will have to create a class that you will deserialize this JSON into.
public class CollectionOfMyClass
{
public List<MyClass> Classes { get; set; }
}
public class MyClass
{
public object Value { get; set; }
public object Type { get; set; }
}
Then to deserialize using Newtonsoft.Json
public CollectionOfMyClass GetCollection(string jsonString)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<CollectionOfMyClass>(jsonString);
}
Option 2: this is a more generic approach
Json:
[
{"value": "sdasd", "type": "int"},
{"value": "sds", "type": "boolean"},
{"value": "sd", "type": "string"},
{"value": "sdds", "type": "datetime"}
]
Deserializing with Newtonsoft.JSON:
public List<Dictionary<object, object>> GetCollection1(string jsonString)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<object, object>>>(jsonString);
}