Class UInt16Serializer
- Namespace
- MongoDB.Bson.Serialization.Serializers
- Assembly
- MongoDB.Bson.dll
Represents a serializer for UInt16s.
[CLSCompliant(false)]
public class UInt16Serializer : StructSerializerBase<ushort>, IBsonSerializer<ushort>, IBsonSerializer, IRepresentationConfigurable<UInt16Serializer>, IRepresentationConfigurable, IHasRepresentationSerializer, IRepresentationConverterConfigurable<UInt16Serializer>, IRepresentationConverterConfigurable
- Inheritance
-
UInt16Serializer
- Implements
- Inherited Members
- Extension Methods
Constructors
UInt16Serializer()
Initializes a new instance of the UInt16Serializer class.
public UInt16Serializer()
UInt16Serializer(BsonType)
Initializes a new instance of the UInt16Serializer class.
public UInt16Serializer(BsonType representation)
Parameters
representation
BsonTypeThe representation.
UInt16Serializer(BsonType, RepresentationConverter)
Initializes a new instance of the UInt16Serializer class.
public UInt16Serializer(BsonType representation, RepresentationConverter converter)
Parameters
representation
BsonTypeThe representation.
converter
RepresentationConverterThe converter.
Properties
Converter
Gets the converter.
public RepresentationConverter Converter { get; }
Property Value
- RepresentationConverter
The converter.
Representation
Gets the representation.
public BsonType Representation { get; }
Property Value
- BsonType
The representation.
Methods
Deserialize(BsonDeserializationContext, BsonDeserializationArgs)
Deserializes a value.
public override ushort Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
Parameters
context
BsonDeserializationContextThe deserialization context.
args
BsonDeserializationArgsThe deserialization args.
Returns
- ushort
A deserialized value.
Serialize(BsonSerializationContext, BsonSerializationArgs, ushort)
Serializes a value.
public override void Serialize(BsonSerializationContext context, BsonSerializationArgs args, ushort value)
Parameters
context
BsonSerializationContextThe serialization context.
args
BsonSerializationArgsThe serialization args.
value
ushortThe object.
WithConverter(RepresentationConverter)
Returns a serializer that has been reconfigured with the specified item serializer.
public UInt16Serializer WithConverter(RepresentationConverter converter)
Parameters
converter
RepresentationConverterThe converter.
Returns
- UInt16Serializer
The reconfigured serializer.
WithRepresentation(BsonType)
Returns a serializer that has been reconfigured with the specified representation.
public UInt16Serializer WithRepresentation(BsonType representation)
Parameters
representation
BsonTypeThe representation.
Returns
- UInt16Serializer
The reconfigured serializer.