Class BsonDocumentWrapper
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
objectThe value.
BsonDocumentWrapper(object, IBsonSerializer)
Initializes a new instance of the BsonDocumentWrapper class.
public BsonDocumentWrapper(object value, IBsonSerializer serializer)
Parameters
value
objectThe value.
serializer
IBsonSerializerThe 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
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
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
TypeThe nominal type of the wrapped object.
values
IEnumerableA 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
TNominalTypeThe 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()