I have a similar issue relate in this link Deserialize a JSON array in C#
But I can't catch the array, so if someone can take a look and tell what I'm doing wrong, I would appreciate it. This is my JSON array:
{
"latitude": [
{
"ts": 1677055475800,
"value": "40.480946"
}
],
"longitude": [
{
"ts": 1677055475800,
"value": "-3.37441"
}
]
}
I tried the answer:
class Latitud
{
public Device latitude;
}
class Longitud
{
public Device longitude;
}
class Device
{
public string ts { get; set; }
public int value { get; set; }
}
JavaScriptSerializer ser = new JavaScriptSerializer();
var mylongitude= ser.Deserialize<List<Longitud>>(jsonData);
var mylatitude = ser.Deserialize<List<Latitud>>(jsonData);
What am I doing wrong?