Table of Contents

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 BsonType

The external representation.

BsonTimeSpanOptionsAttribute(BsonType, TimeSpanUnits)

Initializes a new instance of the BsonTimeSpanOptionsAttribute class.

public BsonTimeSpanOptionsAttribute(BsonType representation, TimeSpanUnits units)

Parameters

representation BsonType

The external representation.

units TimeSpanUnits

The TimeSpanUnits.

Properties

Representation

Gets the external representation.

public BsonType Representation { get; }

Property Value

BsonType

Units

Gets or sets the TimeSpanUnits.

public TimeSpanUnits Units { get; set; }

Property Value

TimeSpanUnits

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.