Class BsonRepresentationAttribute
- 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 BsonRepresentationAttribute : BsonSerializationOptionsAttribute, IBsonMemberMapAttribute
- Inheritance
-
BsonRepresentationAttribute
- Implements
- Inherited Members
- Extension Methods
Constructors
BsonRepresentationAttribute(BsonType)
Initializes a new instance of the BsonRepresentationAttribute class.
public BsonRepresentationAttribute(BsonType representation)
Parameters
representation
BsonTypeThe external representation.
Properties
AllowOverflow
Gets or sets whether to allow overflow.
public bool AllowOverflow { get; set; }
Property Value
AllowTruncation
Gets or sets whether to allow truncation.
public bool AllowTruncation { get; set; }
Property Value
Representation
Gets the external representation.
public BsonType Representation { get; }
Property Value
Methods
Apply(IBsonSerializer)
Reconfigures the specified serializer by applying this attribute to it.
protected override IBsonSerializer Apply(IBsonSerializer serializer)
Parameters
serializer
IBsonSerializerThe serializer.
Returns
- IBsonSerializer
A reconfigured serializer.