Table of Contents

Interface IDiscriminatorConvention

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

Represents a discriminator convention.

public interface IDiscriminatorConvention
Extension Methods

Properties

ElementName

Gets the discriminator element name.

string ElementName { get; }

Property Value

string

Methods

GetActualType(IBsonReader, Type)

Gets the actual type of an object by reading the discriminator from a BsonReader.

Type GetActualType(IBsonReader bsonReader, Type nominalType)

Parameters

bsonReader IBsonReader

The reader.

nominalType Type

The nominal type.

Returns

Type

The actual type.

GetDiscriminator(Type, Type)

Gets the discriminator value for an actual type.

BsonValue GetDiscriminator(Type nominalType, Type actualType)

Parameters

nominalType Type

The nominal type.

actualType Type

The actual type.

Returns

BsonValue

The discriminator value.