Table of Contents

Class AsBsonIdAttribute

Namespace
MongoDB.Entities
Assembly
MongoDB.Entities.dll

Use this attribute to mark an object property to store the value in MongoDB as ObjectID if it is a valid ObjectId string. If it is not a valid ObjectId string, it will be stored as string. This is needed for the join record so that the queryables query based on the stored type of the field

[AttributeUsage(AttributeTargets.Property)]
public class AsBsonIdAttribute : BsonSerializerAttribute, IBsonMemberMapAttribute
Inheritance
BsonSerializerAttribute
AsBsonIdAttribute
Implements
IBsonMemberMapAttribute
Inherited Members
BsonSerializerAttribute.Apply(BsonMemberMap)
BsonSerializerAttribute.SerializerType

Constructors

AsBsonIdAttribute()

Use this attribute to mark an object property to store the value in MongoDB as ObjectID if it is a valid ObjectId string. If it is not a valid ObjectId string, it will be stored as string. This is needed for the join record so that the queryables query based on the stored type of the field

public AsBsonIdAttribute()