Class BsonTimeSpanOptionsAttribute
- Namespace
- MongoDB.Bson.Serialization.Attributes
- Assembly
- MongoDB.Bson.dll
Specifies the external representation and related options for this field or property.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class BsonTimeSpanOptionsAttribute : BsonSerializationOptionsAttribute, IBsonMemberMapAttribute
- Inheritance
-
BsonTimeSpanOptionsAttribute
- Implements
- Inherited Members
- Extension Methods
Constructors
BsonTimeSpanOptionsAttribute(BsonType)
Initializes a new instance of the BsonTimeSpanOptionsAttribute class.
public BsonTimeSpanOptionsAttribute(BsonType representation)
Parameters
representation
BsonTypeThe external representation.
BsonTimeSpanOptionsAttribute(BsonType, TimeSpanUnits)
Initializes a new instance of the BsonTimeSpanOptionsAttribute class.
public BsonTimeSpanOptionsAttribute(BsonType representation, TimeSpanUnits units)
Parameters
representation
BsonTypeThe external representation.
units
TimeSpanUnitsThe TimeSpanUnits.
Properties
Representation
Gets the external representation.
public BsonType Representation { get; }
Property Value
Units
Gets or sets the TimeSpanUnits.
public TimeSpanUnits Units { get; set; }
Property Value
Methods
Apply(IBsonSerializer)
Reconfigures the specified serializer by applying this attribute to it.
protected override IBsonSerializer Apply(IBsonSerializer serializer)
Parameters
serializer
IBsonSerializerThe serializer.
Returns
- IBsonSerializer
A reconfigured serializer.