Class BsonDeserializationContext
- Namespace
- MongoDB.Bson.Serialization
- Assembly
- MongoDB.Bson.dll
Represents all the contextual information needed by a serializer to deserialize a value.
public class BsonDeserializationContext
- Inheritance
-
BsonDeserializationContext
- Inherited Members
- Extension Methods
Properties
AllowDuplicateElementNames
Gets a value indicating whether to allow duplicate element names.
public bool AllowDuplicateElementNames { get; }
Property Value
- bool
trueif duplicate element names shoud be allowed; otherwise,false.
DynamicArraySerializer
Gets the dynamic array serializer.
public IBsonSerializer DynamicArraySerializer { get; }
Property Value
- IBsonSerializer
The dynamic array serializer.
DynamicDocumentSerializer
Gets the dynamic document serializer.
public IBsonSerializer DynamicDocumentSerializer { get; }
Property Value
- IBsonSerializer
The dynamic document serializer.
Reader
Gets the reader.
public IBsonReader Reader { get; }
Property Value
- IBsonReader
The reader.
Methods
CreateRoot(IBsonReader, Action<Builder>)
Creates a root context.
public static BsonDeserializationContext CreateRoot(IBsonReader reader, Action<BsonDeserializationContext.Builder> configurator = null)
Parameters
readerIBsonReaderThe reader.
configuratorAction<BsonDeserializationContext.Builder>The configurator.
Returns
- BsonDeserializationContext
A root context.
With(Action<Builder>)
Creates a new context with some values changed.
public BsonDeserializationContext With(Action<BsonDeserializationContext.Builder> configurator = null)
Parameters
configuratorAction<BsonDeserializationContext.Builder>The configurator.
Returns
- BsonDeserializationContext
A new context.