Method Property
- Namespace
- MongoDB.Driver.Encryption
- Assembly
- MongoDB.Driver.Encryption.dll
Property<TField>(Expression<Func<TDocument, TField>>, BsonType, EncryptionAlgorithm?, Guid?)
Adds a property to the schema with encryption settings.
public EncryptedCollectionBuilder<TDocument> Property<TField>(Expression<Func<TDocument, TField>> path, BsonType bsonType, EncryptionAlgorithm? algorithm = null, Guid? keyId = null)
Parameters
path
Expression<Func<TDocument, TField>>The field.
bsonType
BsonTypeThe BSON type of the property.
algorithm
EncryptionAlgorithm?The encryption algorithm to use.
keyId
Guid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TField
The type of the field.
Property<TField>(Expression<Func<TDocument, TField>>, IEnumerable<BsonType>, EncryptionAlgorithm?, Guid?)
Adds a property to the schema with encryption settings.
public EncryptedCollectionBuilder<TDocument> Property<TField>(Expression<Func<TDocument, TField>> path, IEnumerable<BsonType> bsonTypes = null, EncryptionAlgorithm? algorithm = null, Guid? keyId = null)
Parameters
path
Expression<Func<TDocument, TField>>The field.
bsonTypes
IEnumerable<BsonType>The BSON types of the property.
algorithm
EncryptionAlgorithm?The encryption algorithm to use.
keyId
Guid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TField
The type of the field.
Property(FieldDefinition<TDocument>, BsonType, EncryptionAlgorithm?, Guid?)
Adds a property to the schema with encryption settings.
public EncryptedCollectionBuilder<TDocument> Property(FieldDefinition<TDocument> path, BsonType bsonType, EncryptionAlgorithm? algorithm = null, Guid? keyId = null)
Parameters
path
FieldDefinition<TDocument>The field.
bsonType
BsonTypeThe BSON type of the property.
algorithm
EncryptionAlgorithm?The encryption algorithm to use.
keyId
Guid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Property(FieldDefinition<TDocument>, IEnumerable<BsonType>, EncryptionAlgorithm?, Guid?)
Adds a property to the schema with encryption settings.
public EncryptedCollectionBuilder<TDocument> Property(FieldDefinition<TDocument> path, IEnumerable<BsonType> bsonTypes = null, EncryptionAlgorithm? algorithm = null, Guid? keyId = null)
Parameters
path
FieldDefinition<TDocument>The field.
bsonTypes
IEnumerable<BsonType>The BSON types of the property.
algorithm
EncryptionAlgorithm?The encryption algorithm to use.
keyId
Guid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Property<TField>(Expression<Func<TDocument, TField>>, Action<EncryptedCollectionBuilder<TField>>)
Adds a nested property to the schema.
public EncryptedCollectionBuilder<TDocument> Property<TField>(Expression<Func<TDocument, TField>> path, Action<EncryptedCollectionBuilder<TField>> configure)
Parameters
path
Expression<Func<TDocument, TField>>The field.
configure
Action<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TField
The type of the nested field.
Property<TField>(FieldDefinition<TDocument>, Action<EncryptedCollectionBuilder<TField>>)
Adds a nested property to the schema.
public EncryptedCollectionBuilder<TDocument> Property<TField>(FieldDefinition<TDocument> path, Action<EncryptedCollectionBuilder<TField>> configure)
Parameters
path
FieldDefinition<TDocument>The field.
configure
Action<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TField
The type of the nested field.