我正在尝试反序列化这个 json 文件:
{
"result":
{
"car1":{"lat":37.989728,"long":23.664633},
"car2":{"lat":38.008027,"long":23.774068}
}
}
我试过这样:
public static void parseJson(string data)
{
Result all = JsonConvert.DeserializeObject<Result>(data);
}
public class Result
{
public Car Car { get; set; }
}
public class Car
{
public string lat { get; set; }
public string lon { get; set; }
}
但是对象all
仍然为空