Table of Contents

Class BsonElementAttribute

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

Specifies the element name and related options for a field or property.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class BsonElementAttribute : Attribute, IBsonMemberMapAttribute
Inheritance
BsonElementAttribute
Implements
Inherited Members
Extension Methods

Constructors

BsonElementAttribute()

Initializes a new instance of the BsonElementAttribute class.

public BsonElementAttribute()

BsonElementAttribute(string)

Initializes a new instance of the BsonElementAttribute class.

public BsonElementAttribute(string elementName)

Parameters

elementName string

The name of the element.

Properties

ElementName

Gets the element name.

public string ElementName { get; }

Property Value

string

Order

Gets the 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.