upgrade to MongoDb Driver 2.18 - 2.19 seems to have some broken some tests, investigating.

This commit is contained in:
Alexandre Spieser
2023-08-02 22:56:58 +01:00
parent 9812bded04
commit 710b7b992f
12 changed files with 96 additions and 48 deletions
@@ -23,20 +23,5 @@ namespace IntegrationTests.Infrastructure
{
MongoDbContext.DropCollection<TDocument>(partitionKey);
}
/// <summary>
/// Gets the max of a property in a mongodb collections that is satisfying the filter.
/// </summary>
/// <typeparam name="TDocument">The document type.</typeparam>
/// <typeparam name="TKey">The type of the primary key.</typeparam>
/// <returns></returns>
public async Task<TDocument> GetByMaxAsync<TDocument, TKey>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, object>> orderByDescending)
where TDocument : IDocument<TKey>
where TKey : System.IEquatable<TKey>
{
return await GetCollection<TDocument, TKey>().Find(Builders<TDocument>.Filter.Where(filter))
.SortByDescending(orderByDescending)
.FirstOrDefaultAsync();
}
}
}