public static Task <int> CountAsyncLinqToDB <TSource>(
     this IQueryable <TSource> source,
     CancellationToken token = default)
 => AsyncExtensions.CountAsync(source.ToLinqToDB(), token);
 public static Task <int> CountAsyncLinqToDB <TSource>(
     this IQueryable <TSource> source,
     Expression <Func <TSource, bool> > predicate,
     CancellationToken token = default)
 => AsyncExtensions.CountAsync(source.ToLinqToDB(), predicate, token);
 /// <summary>
 /// Returns the number of elements in the specified sequence that satisfies a condition
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of source</typeparam>
 /// <param name="source">An sequence that contains the elements to be counted</param>
 /// <param name="predicate">A function to test each element for a condition</param>
 /// <returns>
 /// The number of elements in the sequence that satisfies the condition in the predicate
 /// function
 /// </returns>
 public static Task <int> CountAsync <TSource>(this IQueryable <TSource> source,
                                               Expression <Func <TSource, bool> > predicate = null)
 {
     return(predicate == null?AsyncExtensions.CountAsync(source) : AsyncExtensions.CountAsync(source, predicate));
 }