如何使用JsonConvert.DeserializeObject下面的JsonJson的反序列化在C#
[{
"attributes" : {
"type" : "User",
"url" : "/xx/xx/xx"
},
"Id" : "1",
"Name" : "abc"
},{
"attributes" : {
"type" : "User",
"url" : "/xx/xx/xx"
},
"Id" : "2",
"Name" : "abc"
},{
"attributes" : {
"type" : "User",
"url" : "/xx/xx/xx"
},
"Id" : "3",
"Name" : "abc"
}]
這些都是我的課
public class Attributes
{
public string type { get; set; }
public string url { get; set; }
}
public class RootObject
{
public Attributes attributes { get; set; }
public string Id { get; set; }
public string Name { get; set; }
}
我與
var c = JsonConvert.DeserializeObject <RootObject>(jsonText);
所以你試了一下.. *和*? (請注意,JSON根對象是一個*數組*。) – user2864740
0剩餘標誌...這是100個帖子的重複。 –