Table of Contents

Method TryRegisterSerializer

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

TryRegisterSerializer(Type, IBsonSerializer)

Tries to register the serializer.

public bool TryRegisterSerializer(Type type, IBsonSerializer serializer)

Parameters

type Type

The type.

serializer IBsonSerializer

The serializer.

Returns

bool

True if the serializer was registered on this call, false if the same serializer was already registered on a previous call, throws an exception if a different serializer was already registered.