Table of Contents

Class BsonIdAttribute

Namespace
MongoDB.Bson.Serialization.Attributes
Assembly
MongoDB.Bson.dll

Specifies that this is the Id field or property.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
[BsonMemberMapAttributeUsage(AllowMultipleMembers = false)]
public class BsonIdAttribute : Attribute, IBsonMemberMapAttribute
Inheritance
BsonIdAttribute
Implements
Inherited Members
Extension Methods

Constructors

BsonIdAttribute()

Initializes a new instance of the BsonIdAttribute class.

public BsonIdAttribute()

Properties

IdGenerator

Gets or sets the Id generator for the Id.

public Type IdGenerator { get; set; }

Property Value

Type

Order

Gets or sets the Id element serialization order.

public int Order { get; set; }

Property Value

int

Methods

Apply(BsonMemberMap)

Applies a modification to the member map.

public void Apply(BsonMemberMap memberMap)

Parameters

memberMap BsonMemberMap

The member map.