Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在CSharp中反序列化OrientDB的JSON响应_C#_Json_Serialization_Orientdb - Fatal编程技术网

C# 在CSharp中反序列化OrientDB的JSON响应

C# 在CSharp中反序列化OrientDB的JSON响应,c#,json,serialization,orientdb,C#,Json,Serialization,Orientdb,我开始测试OrientDB。我从演示数据库获得以下JSON响应: { "schema":{ "name":"OUser", "properties":{ "roles":{ "name":"roles", "linkedClass":"ORole", "type":"LINKSET", "mandatory

我开始测试OrientDB。我从演示数据库获得以下JSON响应:

{
    "schema":{
        "name":"OUser",
        "properties":{
            "roles":{
                "name":"roles",
                "linkedClass":"ORole",
                "type":"LINKSET",
                "mandatory":false,
                "notNull":true,
                "min":null,
                "max":null
            },
            "name":{
                "name":"name",
                "type":"STRING",
                "mandatory":true,
                "notNull":false,
                "min":null,
                "max":null
            },
            "password":{
                "name":"password",
                "type":"STRING",
                "mandatory":true,
                "notNull":false,
                "min":null,
                "max":null
            }
        }
    },
    "result":[
        {
            "@type":"d",
            "@rid":"#4:0",
            "@version":0,
            "@class":"OUser",
            "name":"admin",
            "password":"{SHA-256}8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918",
            "status":"ACTIVE",
            "roles":[
                "#3:0"
            ]
        },
        {
            "@type":"d",
            "@rid":"#4:1",
            "@version":0,
            "@class":"OUser",
            "name":"reader",
            "password":"{SHA-256}3D0941964AA3EBDCB00CCEF58B1BB399F9F898465E9886D5AEC7F31090A0FB30",
            "status":"ACTIVE",
            "roles":[
                "#3:1"
            ]
        },
        {
            "@type":"d",
            "@rid":"#4:2",
            "@version":0,
            "@class":"OUser",
            "name":"writer",
            "password":"{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5",
            "status":"ACTIVE",
            "roles":[
                "#3:2"
            ]
        }
    ]
}

你怎么能从中得到一个OUser对象的列表?使用JSON.Net、JavaScriptSerializer或其他什么工具?

有许多用于c#的JSON解析器,位于:
. fastJSON似乎应该非常快。

一旦登录,就可以对USER类执行查询:

select from ouser
通过HTTP协议将是针对以下地址的GET请求:

]
}

这看起来是一个使用json.NET进行反序列化的简单结构

{  
  "result": [{
    "@type": "d", "@rid": "#4:0", "@version": 0, "@class": "OUser", 
    "name": "admin", 
    "password": "{SHA-256}8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918", 
    "status": "ACTIVE", 
    "roles": ["#3:0"]
  }, {
    "@type": "d", "@rid": "#4:1", "@version": 2, "@class": "OUser", 
    "name": "reader", 
    "password": "{SHA-256}3D0941964AA3EBDCB00CCEF58B1BB399F9F898465E9886D5AEC7F31090A0FB30", 
    "status": "ACTIVE", 
    "roles": ["#3:1"]
  }, {
    "@type": "d", "@rid": "#4:2", "@version": 0, "@class": "OUser", 
    "name": "writer", 
    "password": "{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5", 
    "status": "ACTIVE", 
    "roles": ["#3:2"]
  }