-2
這是一個我想將它映射到C#poco類的json文檔。我寫了一些課,但他們沒有工作。我的結果對象中有空。有任何想法嗎?Json在C中沒有正確映射#
我使用了Newtonsoft的json轉換器。
{
"retrieval-response":{
"cdata":{
"identifier":"777400",
"document-count":"62"
},
"index":"10",
"count":"25"
}
}
C#map classes;
public class result
{
[JsonProperty("retrieval-response")]
public aResult res { get; set; }
public int index { get; set; }
public int count { get; set; }
}
public class aResult
{
public cdata data { get; set; }
}
public class cdata
{
[JsonProperty("identifier")]
public string identif { get; set; }
[JsonProperty("document-count")]
public string count { get; set; }
}
映射?映射如何? – Liam