Class BsonSerializationContext
- Namespace
- MongoDB.Bson.Serialization
- Assembly
- MongoDB.Bson.dll
Represents all the contextual information needed by a serializer to serialize a value.
public class BsonSerializationContext
- Inheritance
-
BsonSerializationContext
- Inherited Members
- Extension Methods
Properties
IsDynamicType
Gets a function that, when executed, will indicate whether the type is a dynamic type.
public Func<Type, bool> IsDynamicType { get; }
Property Value
Writer
Gets the writer.
public IBsonWriter Writer { get; }
Property Value
- IBsonWriter
The writer.
Methods
CreateRoot(IBsonWriter, Action<Builder>)
Creates a root context.
public static BsonSerializationContext CreateRoot(IBsonWriter writer, Action<BsonSerializationContext.Builder> configurator = null)
Parameters
writer
IBsonWriterThe writer.
configurator
Action<BsonSerializationContext.Builder>The serialization context configurator.
Returns
- BsonSerializationContext
A root context.
With(Action<Builder>)
Creates a new context with some values changed.
public BsonSerializationContext With(Action<BsonSerializationContext.Builder> configurator = null)
Parameters
configurator
Action<BsonSerializationContext.Builder>The serialization context configurator.
Returns
- BsonSerializationContext
A new context.