What should be the class for de-serializing this 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"
}
I tried with this class but I am not sure how to get the file names.
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; }
}
I am trying to convert back and forth a Couchbase document using the sync gateway REST API. When the attachments are to be handled I have issues in converting them the document to .net objects.