这个json反序列化的类应该是什么?
{
"_attachments": {
"Test.png": {
"content_type": "application/octet-stream",
"digest": "sha1-wGqfYwROlnGdNmiVIEpiTKHTm5I=",
"length": 2461,
"revpos": 10,
"stub": true
},
"Test1.png": {
"content_type": "application/octet-stream",
"digest": "sha1-wGqfYwROlnGdNmiVIEpiTKHTm5I=",
"length": 2461,
"revpos": 11,
"stub": true
}
},
"_rev": "11-8fa68244426ebf7643d1c59c44dd0ae9",
"_id": "a20191999c9e8372c577638ac9b8b205"
}
我尝试过这个课程,但我不知道如何获取文件名。
public class Attachment
{
public string content_type { get; set; }
public string digest { get; set; }
public int length { get; set; }
public int revpos { get; set; }
public bool stub { get; set; }
}
public class Document
{
string _id { get; set; }
string _rev { get; set; }
List<Attachment> _attachments { get; set; }
}
我正在尝试使用同步网关REST API来回转换Couchbase文档。当要处理附件时,我在将文档转换为.net对象时遇到问题。