Table of Contents

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

bool

Kind

Gets or sets the DateTimeKind (Local, Unspecified or Utc).

public DateTimeKind Kind { get; set; }

Property Value

DateTimeKind

Representation

Gets or sets the external representation.

public BsonType Representation { get; set; }

Property Value

BsonType

Methods

Apply(IBsonSerializer)

Reconfigures the specified serializer by applying this attribute to it.

protected override IBsonSerializer Apply(IBsonSerializer serializer)

Parameters

serializer IBsonSerializer

The serializer.

Returns

IBsonSerializer

A reconfigured serializer.