Class BsonDocumentBackedClass
- Namespace
- MongoDB.Bson.Serialization
- Assembly
- MongoDB.Bson.dll
A class backed by a BsonDocument.
public abstract class BsonDocumentBackedClass
- Inheritance
-
BsonDocumentBackedClass
- Inherited Members
- Extension Methods
Constructors
BsonDocumentBackedClass(BsonDocument, IBsonDocumentSerializer)
Initializes a new instance of the BsonDocumentBackedClass class.
protected BsonDocumentBackedClass(BsonDocument backingDocument, IBsonDocumentSerializer serializer)
Parameters
backingDocument
BsonDocumentThe backing document.
serializer
IBsonDocumentSerializerThe serializer.
BsonDocumentBackedClass(IBsonDocumentSerializer)
Initializes a new instance of the BsonDocumentBackedClass class.
protected BsonDocumentBackedClass(IBsonDocumentSerializer serializer)
Parameters
serializer
IBsonDocumentSerializerThe serializer.
Properties
BackingDocument
Gets the backing document.
protected BsonDocument BackingDocument { get; }
Property Value
Methods
GetValue<T>(string)
Gets the value from the backing document.
protected T GetValue<T>(string memberName)
Parameters
memberName
stringThe member name.
Returns
- T
The value.
Type Parameters
T
The type of the value.
GetValue<T>(string, T)
Gets the value from the backing document.
protected T GetValue<T>(string memberName, T defaultValue)
Parameters
memberName
stringThe member name.
defaultValue
TThe default value.
Returns
- T
The value.
Type Parameters
T
The type of the value.
SetValue(string, object)
Sets the value in the backing document.
protected void SetValue(string memberName, object value)