Continues refactoring tests, added overload for UpdateOne and UpdateOneAsync so that we can pass a LINQ query to the method.

This commit is contained in:
alexandre-spieser
2018-02-10 16:38:47 +00:00
parent bf2119432e
commit 5270271008
16 changed files with 1193 additions and 424 deletions
@@ -425,26 +425,13 @@ namespace MongoDbGenericRepository
/// <typeparam name="TKey">The type of the primary key.</typeparam>
/// <param name="partitionKey">The collection partition key.</param>
/// <returns></returns>
protected IMongoCollection<TDocument> GetCollection<TDocument, TKey>(string partitionKey)
protected IMongoCollection<TDocument> GetCollection<TDocument, TKey>(string partitionKey = null)
where TDocument : IDocument<TKey>
where TKey : IEquatable<TKey>
{
return MongoDbContext.GetCollection<TDocument, TKey>(partitionKey);
}
/// <summary>
/// Gets a collections for the type TDocument
/// </summary>
/// <typeparam name="TDocument">The document type.</typeparam>
/// <typeparam name="TKey">The type of the primary key.</typeparam>
/// <returns></returns>
protected IMongoCollection<TDocument> GetCollection<TDocument, TKey>()
where TDocument : IDocument<TKey>
where TKey : IEquatable<TKey>
{
return MongoDbContext.GetCollection<TDocument>();
}
/// <summary>
/// Gets a collections for a potentially partitioned document type.
/// </summary>