added unit tests for MongoDBCreator and missing CancellationTokens
This commit is contained in:
@@ -21,7 +21,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="document">The document you want to delete.</param>
|
||||
/// <param name="cancellationToken">An optional cancellation token</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
long DeleteOne<TDocument, TKey>(TDocument document, CancellationToken cancellationToken)
|
||||
long DeleteOne<TDocument, TKey>(TDocument document, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">An optional cancellation token</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
long DeleteOne<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey, CancellationToken cancellationToken)
|
||||
long DeleteOne<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey = default, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="document">The document you want to delete.</param>
|
||||
/// <param name="cancellationToken">The cancellation token</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
Task<long> DeleteOneAsync<TDocument, TKey>(TDocument document, CancellationToken cancellationToken)
|
||||
Task<long> DeleteOneAsync<TDocument, TKey>(TDocument document, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
Task<long> DeleteOneAsync<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey, CancellationToken cancellationToken)
|
||||
Task<long> DeleteOneAsync<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey = default, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
Task<long> DeleteManyAsync<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey, CancellationToken cancellationToken)
|
||||
Task<long> DeleteManyAsync<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey = default, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="documents">The list of documents to delete.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
Task<long> DeleteManyAsync<TDocument, TKey>(IEnumerable<TDocument> documents, CancellationToken cancellationToken)
|
||||
Task<long> DeleteManyAsync<TDocument, TKey>(IEnumerable<TDocument> documents, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="documents">The list of documents to delete.</param>
|
||||
/// <param name="cancellationToken">The cancellation token</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
long DeleteMany<TDocument, TKey>(IEnumerable<TDocument> documents, CancellationToken cancellationToken)
|
||||
long DeleteMany<TDocument, TKey>(IEnumerable<TDocument> documents, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace MongoDbGenericRepository.DataAccess.Delete
|
||||
/// <param name="partitionKey">An optional partition key.</param>
|
||||
/// <param name="cancellationToken">The Cancellation Token</param>
|
||||
/// <returns>The number of documents deleted.</returns>
|
||||
long DeleteMany<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey, CancellationToken cancellationToken)
|
||||
long DeleteMany<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, string partitionKey = default, CancellationToken cancellationToken = default)
|
||||
where TDocument : IDocument<TKey>
|
||||
where TKey : IEquatable<TKey>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user