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
pathExpression<Func<TDocument, TField>>The field.
bsonTypeBsonTypeThe BSON type of the property.
algorithmEncryptionAlgorithm?The encryption algorithm to use.
keyIdGuid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TFieldThe 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
pathExpression<Func<TDocument, TField>>The field.
bsonTypesIEnumerable<BsonType>The BSON types of the property.
algorithmEncryptionAlgorithm?The encryption algorithm to use.
keyIdGuid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TFieldThe 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
pathFieldDefinition<TDocument>The field.
bsonTypeBsonTypeThe BSON type of the property.
algorithmEncryptionAlgorithm?The encryption algorithm to use.
keyIdGuid?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
pathFieldDefinition<TDocument>The field.
bsonTypesIEnumerable<BsonType>The BSON types of the property.
algorithmEncryptionAlgorithm?The encryption algorithm to use.
keyIdGuid?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
pathExpression<Func<TDocument, TField>>The field.
configureAction<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TFieldThe 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
pathFieldDefinition<TDocument>The field.
configureAction<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TFieldThe type of the nested field.