小编Jil*_*lji的帖子

Json在C#中反序列化

如何在Json下面使用JsonConvert.DeserializeObject

[{
  "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"
}]
Run Code Online (Sandbox Code Playgroud)

这些是我的班级

public class Attributes
{
    public string type { get; set; }
    public string url { get; set; }
}

public class RootObject
{
    public Attributes attributes …
Run Code Online (Sandbox Code Playgroud)

c# json json.net

1
推荐指数
1
解决办法
637
查看次数

标签 统计

c# ×1

json ×1

json.net ×1