Table of Contents

Method GetSerializer

Namespace
MongoDB.Bson.Serialization
Assembly
MongoDB.Bson.dll

GetSerializer(Type)

Gets the serializer for the specified type. If none is already registered, the serialization providers will be used to create a serializer and it will be automatically registered.

public IBsonSerializer GetSerializer(Type type)

Parameters

type Type

The type.

Returns

IBsonSerializer

The serializer.

GetSerializer<T>()

Gets the serializer for the specified T. If none is already registered, the serialization providers will be used to create a serializer and it will be automatically registered.

public IBsonSerializer<T> GetSerializer<T>()

Returns

IBsonSerializer<T>

The serializer.

Type Parameters

T

The value type of the serializer.