I am writing a deserializer callback method to parse some Json response in C# silverlight.
But the problem is the response is constructed by a bunch of objects and not in an array form.
To be specific, normally when we want to parse something from a json, if that's a list of object, it will look like this in some Json visualizer:
we can do something like:
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(ObjType[]));
ObjType[] response = (ObjType[])jsonSerializer.ReadObject(stream);
But now I have the Json file that the structure looks like this:
In this case I dont think I can parse it to an array since the objects are individual and not in an array structure.
A sample of the Json file is:
[
{
"Name":"Mike",
"Gender":"male",
},
{
"Name":"Lucy",
"Gender":"Female ",
},
{
"Name":"Jack",
"Gender":"Male",
}
]
So I am wondering if there is any way I can parse this kind of Json file to an array of defined object.