Table of Contents

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 BsonDocument

The backing document.

serializer IBsonDocumentSerializer

The serializer.

BsonDocumentBackedClass(IBsonDocumentSerializer)

Initializes a new instance of the BsonDocumentBackedClass class.

protected BsonDocumentBackedClass(IBsonDocumentSerializer serializer)

Parameters

serializer IBsonDocumentSerializer

The serializer.

Properties

BackingDocument

Gets the backing document.

protected BsonDocument BackingDocument { get; }

Property Value

BsonDocument

Methods

GetValue<T>(string)

Gets the value from the backing document.

protected T GetValue<T>(string memberName)

Parameters

memberName string

The 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 string

The member name.

defaultValue T

The 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)

Parameters

memberName string

The member name.

value object

The value.