How can I deserialize this information.
{"games":"[
[ID, Descripcion1, Descripcion2, Descripcion3],
[222, Halo, $2333, null],
[333, Sugar, $333, null]]}
"
How can I deserialize this information.
{"games":"[
[ID, Descripcion1, Descripcion2, Descripcion3],
[222, Halo, $2333, null],
[333, Sugar, $333, null]]}
"
You can not because it is badly formed, in several aspects, one of them is that you have some quotes right after "games":
{
"games":
"[
[ID, Descripcion1, Descripcion2, Descripcion3],
[
222, Halo,$2333, null
],
[
333, Sugar, $333, null]
]
}
Once the solutions, there is more to be done anyway, since that object is not a valid JSON object. You should expose it like this
{
"games": [
{
"Id": "222",
"Descripcion1": "Halo",
"Descripcion2": "$2333",
"Descripcion3": null
},
{
"Id": "333",
"Descripcion1": "Sugar",
"Descripcion2": "$333",
"Descripcion3": null
}
]
}
And being that way you could deserialize it in objects of these classes
public class Game
{
public string Id { get; set; }
public string Descripcion1 { get; set; }
public string Descripcion2 { get; set; }
public object Descripcion3 { get; set; }
}
public class RootObject
{
public List<Game> games { get; set; }
}
Using Newtonsoft JSON
RootObject g = JsonConvert.DeserializeObject<RootObject>(json);