0
我从zoho获得json。我有这样一个JSON如下:Json反序列化没有结果
{
"response": {
"result": {
"Leads": {
"row": [
{
"no": "1",
"FL": [
{
"content": "1325469000000679001",
"val": "LEADID"
},
{
"content": "1325469000000075001",
"val": "SMOWNERID"
},
{
"content": "Geoff",
"val": "Lead Owner"
},
]
},
{
"no": "2",
"FL": [
{
"content": "1325469000000659017",
"val": "LEADID"
},
{
"content": "1325469000000075001",
"val": "SMOWNERID"
},
{
"content": "Geoff",
"val": "Lead Owner"
},
]
},
]
}
},
"uri": "/crm/private/json/Leads/getRecords"
}
}
我使用以下类:
public class Row
{
[JsonProperty(PropertyName = "row")]
public List<Leads> row { get; set; }
}
public class Leads
{
[JsonProperty(PropertyName = "no")]
public string nbr { get; set; }
[JsonProperty(PropertyName = "FL")]
public List<Lead> FieldValues { get; set; }
}
public class Lead
{
[JsonProperty(PropertyName = "content")]
public string Content { get; set; }
[JsonProperty(PropertyName = "val")]
public string Val { get; set; }
}
我尝试反序列化JSON,并取回什么:
var mList = JsonConvert.DeserializeObject<IDictionary<string, Row>>(result);
这是第一次与Json合作,所以任何帮助将不胜感激!
http://www.newtonsoft.com/json/help/html/SerializationAttributes.htm – 2015-04-02 20:26:15
使用剪贴板上的JSON字符串,您可以执行**编辑 - >选择性粘贴 - >粘贴JSON作为类**和VS会为你创建JSON的类 – Plutonix 2015-04-02 20:42:56