tokens for updater and unit tests
This commit is contained in:
@@ -19,7 +19,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="modifiedDocument">The document with the modifications you want to persist.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(TDocument modifiedDocument)
|
||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(TDocument modifiedDocument, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -30,7 +31,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="documentToModify">The document you want to modify.</param>
|
||||
/// <param name="update">The update definition for the document.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(TDocument documentToModify, UpdateDefinition<TDocument> update)
|
||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(TDocument documentToModify, UpdateDefinition<TDocument> update, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -43,7 +45,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="documentToModify">The document you want to modify.</param>
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value)
|
||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -57,7 +60,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The value of the partition key.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -71,7 +75,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The partition key for the document.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -84,7 +89,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="modifiedDocument">The document with the modifications you want to persist.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(IClientSessionHandle session, TDocument modifiedDocument, CancellationToken cancellationToken = default(CancellationToken))
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(IClientSessionHandle session, TDocument modifiedDocument, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -98,7 +103,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="update">The update definition.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(IClientSessionHandle session, TDocument documentToModify, UpdateDefinition<TDocument> update, CancellationToken cancellationToken = default(CancellationToken))
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey>(IClientSessionHandle session, TDocument documentToModify, UpdateDefinition<TDocument> update, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -108,13 +113,13 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <typeparam name="TField">The type of the field to update.</typeparam>
|
||||
/// <param name="session">The client session.</param>
|
||||
/// <param name="session">The client session.</param>
|
||||
/// <param name="documentToModify">The document to modify.</param>
|
||||
/// <param name="field">The field to update.</param>
|
||||
/// <param name="value">The value of the field.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(IClientSessionHandle session, TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value, CancellationToken cancellationToken = default(CancellationToken))
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(IClientSessionHandle session, TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -131,7 +136,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="partitionKey">The optional partition key.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(IClientSessionHandle session, FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(IClientSessionHandle session, FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -148,7 +153,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="partitionKey">The optional partition key.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(IClientSessionHandle session, Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
Task<bool> UpdateOneAsync<TDocument, TKey, TField>(IClientSessionHandle session, Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -158,7 +163,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="modifiedDocument">The document with the modifications you want to persist.</param>
|
||||
bool UpdateOne<TDocument, TKey>(TDocument modifiedDocument)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
bool UpdateOne<TDocument, TKey>(TDocument modifiedDocument, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -169,7 +175,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="documentToModify">The document you want to modify.</param>
|
||||
/// <param name="update">The update definition for the document.</param>
|
||||
bool UpdateOne<TDocument, TKey>(TDocument documentToModify, UpdateDefinition<TDocument> update)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
bool UpdateOne<TDocument, TKey>(TDocument documentToModify, UpdateDefinition<TDocument> update, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -182,7 +189,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="documentToModify">The document you want to modify.</param>
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
bool UpdateOne<TDocument, TKey, TField>(TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
bool UpdateOne<TDocument, TKey, TField>(TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -196,7 +204,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The value of the partition key.</param>
|
||||
bool UpdateOne<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
bool UpdateOne<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -210,7 +219,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The partition key for the document.</param>
|
||||
bool UpdateOne<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
bool UpdateOne<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -223,7 +233,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="modifiedDocument">The document with the modifications you want to persist.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
bool UpdateOne<TDocument, TKey>(IClientSessionHandle session, TDocument modifiedDocument, CancellationToken cancellationToken = default(CancellationToken))
|
||||
bool UpdateOne<TDocument, TKey>(IClientSessionHandle session, TDocument modifiedDocument, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -237,7 +247,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="update">The update definition.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
bool UpdateOne<TDocument, TKey>(IClientSessionHandle session, TDocument documentToModify, UpdateDefinition<TDocument> update, CancellationToken cancellationToken = default(CancellationToken))
|
||||
bool UpdateOne<TDocument, TKey>(IClientSessionHandle session, TDocument documentToModify, UpdateDefinition<TDocument> update, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -253,7 +263,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="value">The value of the field.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
bool UpdateOne<TDocument, TKey, TField>(IClientSessionHandle session, TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value, CancellationToken cancellationToken = default(CancellationToken))
|
||||
bool UpdateOne<TDocument, TKey, TField>(IClientSessionHandle session, TDocument documentToModify, Expression<Func<TDocument, TField>> field, TField value, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -270,7 +280,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="partitionKey">The optional partition key.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
bool UpdateOne<TDocument, TKey, TField>(IClientSessionHandle session, FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
bool UpdateOne<TDocument, TKey, TField>(IClientSessionHandle session, FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -287,7 +297,7 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="partitionKey">The optional partition key.</param>
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
/// <returns></returns>
|
||||
bool UpdateOne<TDocument, TKey, TField>(IClientSessionHandle session, Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
bool UpdateOne<TDocument, TKey, TField>(IClientSessionHandle session, Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -301,7 +311,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The partition key for the document.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -315,7 +326,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The value of the partition key.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -325,9 +337,10 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
|
||||
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
|
||||
/// <param name="filter">The document filter.</param>
|
||||
/// <param name="update">the update definiton</param>
|
||||
/// <param name="update">the update definition</param>
|
||||
/// <param name="partitionKey">The value of the partition key.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, UpdateDefinition<TDocument> update, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, UpdateDefinition<TDocument> update, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -339,7 +352,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="filter">The document filter.</param>
|
||||
/// <param name="updateDefinition">The update definition.</param>
|
||||
/// <param name="partitionKey">The value of the partition key.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey>(FilterDefinition<TDocument> filter, UpdateDefinition<TDocument> updateDefinition, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
Task<long> UpdateManyAsync<TDocument, TKey>(FilterDefinition<TDocument> filter, UpdateDefinition<TDocument> updateDefinition, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -353,7 +367,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The partition key for the document.</param>
|
||||
long UpdateMany<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
long UpdateMany<TDocument, TKey, TField>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -367,7 +382,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="field">The field selector.</param>
|
||||
/// <param name="value">The new value of the property field.</param>
|
||||
/// <param name="partitionKey">The value of the partition key.</param>
|
||||
long UpdateMany<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
long UpdateMany<TDocument, TKey, TField>(FilterDefinition<TDocument> filter, Expression<Func<TDocument, TField>> field, TField value, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -379,7 +395,8 @@ namespace MongoDbGenericRepository.DataAccess.Update
|
||||
/// <param name="filter">The document filter.</param>
|
||||
/// <param name="updateDefinition">The update definition.</param>
|
||||
/// <param name="partitionKey">The value of the partition key.</param>
|
||||
long UpdateMany<TDocument, TKey>(FilterDefinition<TDocument> filter, UpdateDefinition<TDocument> updateDefinition, string partitionKey = null)
|
||||
/// <param name="cancellationToken">The optional cancellation token.</param>
|
||||
long UpdateMany<TDocument, TKey>(FilterDefinition<TDocument> filter, UpdateDefinition<TDocument> updateDefinition, string partitionKey = null, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user