Example #1
0
 /// <inheritdoc cref="AsyncExtensions.SumAsync(IQueryable{decimal?}, CancellationToken)"/>
 public static Task <decimal?> SumAsyncLinqToDB(
     this IQueryable <decimal?> source,
     CancellationToken token = default)
 => AsyncExtensions.SumAsync(source.ToLinqToDB(), token);
Example #2
0
 /// <inheritdoc cref="AsyncExtensions.SumAsync{TSource}(IQueryable{TSource}, Expression{Func{TSource, int}}, CancellationToken)"/>
 public static Task <int> SumAsyncLinqToDB <TSource>(
     this IQueryable <TSource> source,
     Expression <Func <TSource, int> > selector,
     CancellationToken token = default)
 => AsyncExtensions.SumAsync(source.ToLinqToDB(), selector, token);
Example #3
0
 /// <summary>
 /// Computes the sum of the sequence that is obtained
 /// by invoking a projection function on each element of the input sequence
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of source</typeparam>
 /// <param name="source">A sequence of values of type TSource</param>
 /// <param name="predicate">A projection function to apply to each element</param>
 /// <returns>
 /// A task that represents the asynchronous operation
 /// The task result contains the sum of the projected values
 /// </returns>
 public static Task <float> SumAsync <TSource>(this IQueryable <TSource> source,
                                               Expression <Func <TSource, float> > predicate)
 {
     return(AsyncExtensions.SumAsync(source, predicate));
 }