Table of Contents

Class BsonDocumentWrapper

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BsonDocument wrapper.

public class BsonDocumentWrapper : MaterializedOnDemandBsonDocument, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonDocument>, IConvertibleToBsonDocument, IEnumerable<BsonElement>, IEnumerable, IEquatable<BsonDocument>, IDisposable
Inheritance
BsonDocumentWrapper
Implements
Inherited Members
Extension Methods

Constructors

BsonDocumentWrapper(object)

Initializes a new instance of the BsonDocumentWrapper class.

public BsonDocumentWrapper(object value)

Parameters

value object

The value.

BsonDocumentWrapper(object, IBsonSerializer)

Initializes a new instance of the BsonDocumentWrapper class.

public BsonDocumentWrapper(object value, IBsonSerializer serializer)

Parameters

value object

The value.

serializer IBsonSerializer

The serializer.

Properties

Serializer

Gets the serializer.

public IBsonSerializer Serializer { get; }

Property Value

IBsonSerializer

The serializer.

Wrapped

Gets the wrapped value.

public object Wrapped { get; }

Property Value

object

Methods

Clone()

Creates a shallow clone of the document (see also DeepClone).

public override BsonValue Clone()

Returns

BsonValue

A shallow clone of the document.

Create(Type, object)

Creates a new instance of the BsonDocumentWrapper class.

public static BsonDocumentWrapper Create(Type nominalType, object value)

Parameters

nominalType Type

The nominal type of the wrapped object.

value object

The wrapped object.

Returns

BsonDocumentWrapper

A BsonDocumentWrapper.

CreateMultiple(Type, IEnumerable)

Creates a list of new instances of the BsonDocumentWrapper class.

public static IEnumerable<BsonDocumentWrapper> CreateMultiple(Type nominalType, IEnumerable values)

Parameters

nominalType Type

The nominal type of the wrapped object.

values IEnumerable

A list of wrapped objects.

Returns

IEnumerable<BsonDocumentWrapper>

A list of BsonDocumentWrappers.

CreateMultiple<TNominalType>(IEnumerable<TNominalType>)

Creates a list of new instances of the BsonDocumentWrapper class.

public static IEnumerable<BsonDocumentWrapper> CreateMultiple<TNominalType>(IEnumerable<TNominalType> values)

Parameters

values IEnumerable<TNominalType>

A list of wrapped objects.

Returns

IEnumerable<BsonDocumentWrapper>

A list of BsonDocumentWrappers.

Type Parameters

TNominalType

The nominal type of the wrapped objects.

Create<TNominalType>(TNominalType)

Creates a new instance of the BsonDocumentWrapper class.

public static BsonDocumentWrapper Create<TNominalType>(TNominalType value)

Parameters

value TNominalType

The wrapped object.

Returns

BsonDocumentWrapper

A BsonDocumentWrapper.

Type Parameters

TNominalType

The nominal type of the wrapped object.

Materialize()

Materializes the BsonDocument.

protected override IEnumerable<BsonElement> Materialize()

Returns

IEnumerable<BsonElement>

The materialized elements.

MaterializeCompleted()

Informs subclasses that the Materialize process completed so they can free any resources related to the unmaterialized state.

protected override void MaterializeCompleted()