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
stringThe name of the element.
Properties
ElementName
Gets the element name.
public string ElementName { get; }
Property Value
Order
Gets the element serialization order.
public int Order { get; set; }
Property Value
Methods
Apply(BsonMemberMap)
Applies a modification to the member map.
public void Apply(BsonMemberMap memberMap)
Parameters
memberMap
BsonMemberMapThe member map.