有没有办法只序列化我的对象的私有字段,它在 MongoDB中具有DataMember属性?
string json =
item.ToJson(
new MongoDB.Bson.IO.JsonWriterSettings()
{
GuidRepresentation = GuidRepresentation.Standard,
Indent = false,
OutputMode = MongoDB.Bson.IO.JsonOutputMode.JavaScript
}
);