Class BsonDateTimeOptionsAttribute
- Namespace
- MongoDB.Bson.Serialization.Attributes
- Assembly
- MongoDB.Bson.dll
Specifies serialization options for a DateTime field or property.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class BsonDateTimeOptionsAttribute : BsonSerializationOptionsAttribute, IBsonMemberMapAttribute
- Inheritance
-
BsonDateTimeOptionsAttribute
- Implements
- Inherited Members
- Extension Methods
Constructors
BsonDateTimeOptionsAttribute()
Initializes a new instance of the BsonDateTimeOptionsAttribute class.
public BsonDateTimeOptionsAttribute()
Properties
DateOnly
Gets or sets whether the DateTime consists of a Date only.
public bool DateOnly { get; set; }
Property Value
Kind
Gets or sets the DateTimeKind (Local, Unspecified or Utc).
public DateTimeKind Kind { get; set; }
Property Value
Representation
Gets or sets the external representation.
public BsonType Representation { 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.