I have test class which contains some protected and private member:
public class Doc_PrivateValues : Document
{
public int PublicIntProperty { get; set; }
public int PublicIntField;
protected int ProtectedIntProperty { get; set; }
protected int ProtectedIntField;
private int PrivateIntProperty { get; set; }
private int PrivateIntField;
public SimpleDocument PublicDocument;
protected SimpleDocument ProtectedDocument;
private SimpleDocument PrivateDocument;
public SimpleStruct PublicStruct;
protected SimpleStruct ProtectedStruct;
private SimpleStruct PrivateStruct;
}
I save this document into CosmosDB in very Simple Way:
Microsoft.Azure.Documents.Document result = CosmosClient.CreateDocumentAsync( CosmosCollection.SelfLink, document ).Result.Resource;
document.id = result.Id;
And the result in database:
{
"PublicIntField": 2,
"PublicDocument": {
"StrVal": "seven",
"IntVal": 7,
"id": null
},
"PublicStruct": {
"StrVal": "ten",
"IntVal": 10
},
"PublicIntProperty": 1,
"id": "58f18ccf-9e0c-41a6-85cd-a601f12a120a",
"_rid": "mPlfANiOud4BAAAAAAAAAA==",
"_self": "dbs/mPlfAA==/colls/mPlfANiOud4=/docs/mPlfANiOud4BAAAAAAAAAA==/",
"_etag": "\"00000000-0000-0000-8b2a-d853688c01d4\"",
"_attachments": "attachments/",
"_ts": 1543856923
}
The Document is contains only the public members. How can I save the Non public members as well?
Thx!