Exemple #1
0
 /// <summary>
 /// Gets the maximum value 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>
 /// <typeparam name="TValue">The type of the value used to order the query.</typeparam>
 /// <param name="filter">A LINQ expression filter.</param>
 /// <param name="maxValueSelector">A property selector for the maximum value you are looking for.</param>
 /// <param name="partitionKey">An optional partitionKey.</param>
 /// <param name="cancellationToken">An optional cancellation Token.</param>
 public async virtual Task <TValue> GetMaxValueAsync <TDocument, TKey, TValue>(
     Expression <Func <TDocument, bool> > filter,
     Expression <Func <TDocument, TValue> > maxValueSelector,
     string partitionKey = null,
     CancellationToken cancellationToken = default)
     where TDocument : IDocument <TKey>
     where TKey : IEquatable <TKey>
 {
     return(await MongoDbReader.GetMaxValueAsync <TDocument, TKey, TValue>(filter, maxValueSelector, partitionKey, cancellationToken));
 }
 /// <summary>
 /// Gets the maximum value of a property in a mongodb collections that is satisfying the filter.
 /// </summary>
 /// <typeparam name="TDocument">The document type.</typeparam>
 /// <typeparam name="TValue">The type of the value used to order the query.</typeparam>
 /// <param name="filter">A LINQ expression filter.</param>
 /// <param name="maxValueSelector">A property selector to order by ascending.</param>
 /// <param name="partitionKey">An optional partitionKey.</param>
 public async Task <TValue> GetMaxValueAsync <TDocument, TValue>(Expression <Func <TDocument, bool> > filter, Expression <Func <TDocument, TValue> > maxValueSelector, string partitionKey = null)
     where TDocument : IDocument <TKey>
 {
     return(await MongoDbReader.GetMaxValueAsync <TDocument, TKey, TValue>(filter, maxValueSelector, partitionKey));
 }