https://opendata.miamidade.gov/Corrections/Jail-Bookings-May-29-2015-to-current/7nhc-4yqn?查询/反序列化多级字段对象的问题
我不这样做,如果有人可以帮助我:我一直有问题解析/反序列化Location对象内的地址信息。
这是我使用的代码的片段:
var results = dataset.Query<MiamiDade_JailLog>(soql);
public class MiamiDade_JailLog
{
public string chargecode3 { get; set; }
public string charge2 { get; set; }
public string bookdate { get; set; }
public string charge3 { get; set; }
public string chargecode1 { get; set; }
public string chargecode2 { get; set; }
public string charge1 { get; set; }
public string dob { get; set; }
public Location1 location_1 { get; set; }
public string defendant { get; set; }
}
public class Location1
{
public bool needs_recoding { get; set; }
public string longitude { get; set; }
public string latitude { get; set; }
public HumanAddress human_address { get; set; }
}
public class HumanAddress
{
public string address { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
}
,这是错误消息:
误差变换值
"{"address":"HOMELESS","city":"MIAMI","state":"FL","zip":""}"
键入 'JailLog_WFA.HumanAddress'。路径“location_1.human_address”,1号线, 位置424
你使用自己的'Location'和'HumanAddress'类型的任何原因? 'SODA.NET'库(我假设你也使用它)在'SODA.Models'下定义了这些类。你有没有尝试过使用它们? – kaveman