这段代码有什么问题?
JSON
cities: [
{
city: {
id: 1,
name: "A.S.Peta",
status: "Active"
}
},..............
C# 代码
public class Cities
{
public City[] cities;
}
public class City
{
public int id; //{ get; set; }
public string name; //{ get; set; }
public string status; //{ get; set; }
}
//De-Serialization
var jsSerialize = new JavaScriptSerializer();
var cities = jsSerialize.Deserialize<Cities>(result);
不填充内部对象 City。但显示所有记录的集合。任何想法?