Class EnumSerializer<TEnum>
- Namespace
- MongoDB.Bson.Serialization.Serializers
- Assembly
- MongoDB.Bson.dll
Represents a serializer for enums.
public class EnumSerializer<TEnum> : StructSerializerBase<TEnum>, IBsonSerializer<TEnum>, IBsonSerializer, IRepresentationConfigurable<EnumSerializer<TEnum>>, IRepresentationConfigurable, IHasRepresentationSerializer where TEnum : struct, Enum
Type Parameters
TEnum
The type of the enum.
- Inheritance
-
SerializerBase<TEnum>StructSerializerBase<TEnum>EnumSerializer<TEnum>
- Implements
-
IBsonSerializer<TEnum>
- Inherited Members
- Extension Methods
Constructors
- EnumSerializer()
Initializes a new instance of the EnumSerializer<TEnum> class.
- EnumSerializer(BsonType)
Initializes a new instance of the EnumSerializer<TEnum> class.
Properties
- Representation
Gets the representation.
Methods
- Deserialize(BsonDeserializationContext, BsonDeserializationArgs)
Deserializes a value.
- Serialize(BsonSerializationContext, BsonSerializationArgs, TEnum)
Serializes a value.
- WithRepresentation(BsonType)
Returns a serializer that has been reconfigured with the specified representation.