Class TypeMappingSerializationProvider
- Namespace
- MongoDB.Bson.Serialization
- Assembly
- MongoDB.Bson.dll
Represents a serialization provider based on a mapping from value types to serializer types.
public sealed class TypeMappingSerializationProvider : BsonSerializationProviderBase, IRegistryAwareBsonSerializationProvider, IBsonSerializationProvider
- Inheritance
-
TypeMappingSerializationProvider
- Implements
- Inherited Members
- Extension Methods
Constructors
TypeMappingSerializationProvider()
Initializes a new instance of the TypeMappingSerializationProvider class.
public TypeMappingSerializationProvider()
Methods
GetSerializer(Type, IBsonSerializerRegistry)
Gets a serializer for a type.
public override IBsonSerializer GetSerializer(Type type, IBsonSerializerRegistry serializerRegistry)
Parameters
type
TypeThe type.
serializerRegistry
IBsonSerializerRegistryThe serializer registry.
Returns
- IBsonSerializer
A serializer.
RegisterMapping(Type, Type)
Registers the serializer mapping.
public void RegisterMapping(Type type, Type serializerType)