gpt4 book ai didi

c# - 在 CSharp 中反序列化来自 OrientDB 的 JSON 响应

转载 作者:行者123 更新时间:2023-11-30 18:02:22 25 4
gpt4 key购买 nike

我开始测试 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 解析器: http://www.json.org/ .看起来 fastJSON 应该很快。

关于c# - 在 CSharp 中反序列化来自 OrientDB 的 JSON 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8164303/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com