Table of Contents

Constructor ObjectSerializer

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

ObjectSerializer()

Initializes a new instance of the ObjectSerializer class.

public ObjectSerializer()

ObjectSerializer(IDiscriminatorConvention)

Initializes a new instance of the ObjectSerializer class.

public ObjectSerializer(IDiscriminatorConvention discriminatorConvention)

Parameters

discriminatorConvention IDiscriminatorConvention

The discriminator convention.

Exceptions

ArgumentNullException

discriminatorConvention

ObjectSerializer(IDiscriminatorConvention, GuidRepresentation)

Initializes a new instance of the ObjectSerializer class.

public ObjectSerializer(IDiscriminatorConvention discriminatorConvention, GuidRepresentation guidRepresentation)

Parameters

discriminatorConvention IDiscriminatorConvention

The discriminator convention.

guidRepresentation GuidRepresentation

The Guid representation.

ObjectSerializer(Func<Type, bool>)

Initializes a new instance of the ObjectSerializer class.

public ObjectSerializer(Func<Type, bool> allowedTypes)

Parameters

allowedTypes Func<Type, bool>

A delegate that determines what types are allowed.

ObjectSerializer(IDiscriminatorConvention, Func<Type, bool>)

Initializes a new instance of the ObjectSerializer class.

public ObjectSerializer(IDiscriminatorConvention discriminatorConvention, Func<Type, bool> allowedTypes)

Parameters

discriminatorConvention IDiscriminatorConvention

The discriminator convention.

allowedTypes Func<Type, bool>

A delegate that determines what types are allowed.

ObjectSerializer(IDiscriminatorConvention, GuidRepresentation, Func<Type, bool>)

Initializes a new instance of the ObjectSerializer class.

public ObjectSerializer(IDiscriminatorConvention discriminatorConvention, GuidRepresentation guidRepresentation, Func<Type, bool> allowedTypes)

Parameters

discriminatorConvention IDiscriminatorConvention

The discriminator convention.

guidRepresentation GuidRepresentation

The Guid representation.

allowedTypes Func<Type, bool>

A delegate that determines what types are allowed.

ObjectSerializer(IDiscriminatorConvention, GuidRepresentation, Func<Type, bool>, Func<Type, bool>)

Initializes a new instance of the ObjectSerializer class.

public ObjectSerializer(IDiscriminatorConvention discriminatorConvention, GuidRepresentation guidRepresentation, Func<Type, bool> allowedDeserializationTypes, Func<Type, bool> allowedSerializationTypes)

Parameters

discriminatorConvention IDiscriminatorConvention

The discriminator convention.

guidRepresentation GuidRepresentation

The Guid representation.

allowedDeserializationTypes Func<Type, bool>

A delegate that determines what types are allowed to be deserialized.

allowedSerializationTypes Func<Type, bool>

A delegate that determines what types are allowed to be serialized.