Table of Contents

Class SerializeAsNominalTypeSerializer<TActualType, TNominalType>

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

Represents a serializer for a class that will be serialized as if it were one of its base classes.

public class SerializeAsNominalTypeSerializer<TActualType, TNominalType> : SerializerBase<TActualType>, IBsonSerializer<TActualType>, IBsonSerializer where TActualType : class, TNominalType

Type Parameters

TActualType

The actual type.

TNominalType

The nominal type.

Inheritance
SerializerBase<TActualType>
SerializeAsNominalTypeSerializer<TActualType, TNominalType>
Implements
IBsonSerializer<TActualType>
Inherited Members
Extension Methods

Constructors

SerializeAsNominalTypeSerializer()

Initializes a new instance of the SerializeAsNominalTypeSerializer<TActualType, TNominalType> class.

public SerializeAsNominalTypeSerializer()

SerializeAsNominalTypeSerializer(IBsonSerializerRegistry)

Initializes a new instance of the SerializeAsNominalTypeSerializer<TActualType, TNominalType> class.

public SerializeAsNominalTypeSerializer(IBsonSerializerRegistry serializerRegistry)

Parameters

serializerRegistry IBsonSerializerRegistry

The serializer registry.

SerializeAsNominalTypeSerializer(IBsonSerializer<TNominalType>)

Initializes a new instance of the SerializeAsNominalTypeSerializer<TActualType, TNominalType> class.

public SerializeAsNominalTypeSerializer(IBsonSerializer<TNominalType> nominalTypeSerializer)

Parameters

nominalTypeSerializer IBsonSerializer<TNominalType>

The base class serializer.

Methods

Serialize(BsonSerializationContext, BsonSerializationArgs, TActualType)

Serializes a value.

public override void Serialize(BsonSerializationContext context, BsonSerializationArgs args, TActualType value)

Parameters

context BsonSerializationContext

The serialization context.

args BsonSerializationArgs

The serialization args.

value TActualType

The value.