添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Click or drag to resize Click or drag to resize
EnumSerializer TEnum Class
Represents a serializer for enums.
Inheritance Hierarchy

Namespace: MongoDB.Bson.Serialization.Serializers
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: 2.3.0
Syntax
public class EnumSerializer<TEnum> : StructSerializerBase<TEnum>, 
	IRepresentationConfigurable<EnumSerializer<TEnum>>, IRepresentationConfigurable
where TEnum : struct, new()

Type Parameters

TEnum
The type of the enum.

The EnumSerializer TEnum type exposes the following members.

Constructors
Name Description
Public method EnumSerializer TEnum
Initializes a new instance of the EnumSerializer TEnum class.
Public method EnumSerializer TEnum (BsonType)
Initializes a new instance of the EnumSerializer TEnum class.
Top
Properties
Name Description
Public property Representation
Gets the representation.
Public property ValueType
Gets the type of the values.
(Inherited from SerializerBase TValue .)
Top
Methods
Name Description
Protected method CreateCannotBeDeserializedException
Creates an exception to throw when a type cannot be deserialized.
(Inherited from SerializerBase TValue .)
Protected method CreateCannotBeSerializedException
Creates an exception to throw when a type cannot be deserialized.
(Inherited from SerializerBase TValue .)
Protected method CreateCannotDeserializeFromBsonTypeException
Creates an exception to throw when a type cannot be deserialized from a BsonType.
(Inherited from SerializerBase TValue .)
Public method Deserialize
Deserializes a value.
(Overrides SerializerBase TValue Deserialize(BsonDeserializationContext, BsonDeserializationArgs) .)
Protected method EnsureBsonTypeEquals
Ensures that the BsonType equals the expected type.
(Inherited from SerializerBase TValue .)
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object .)
Protected method Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object .)
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object .)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object .)
Protected method MemberwiseClone
Creates a shallow copy of the current Object .
(Inherited from Object .)
Public method Serialize
Serializes a value.
(Overrides SerializerBase TValue Serialize(BsonSerializationContext, BsonSerializationArgs, TValue) .)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object .)
Public method WithRepresentation
Returns a serializer that has been reconfigured with the specified representation.
Top
Extension Methods
Name Description
Public Extension Method ToBson
Serializes an object to a BSON byte array.