5public static class QuerySourceExtensions
7 public static Dictionary<K, V> ToDictionary<K, V>(
this IQuerySource<ValueTuple<K, V>> src) where K : notnull =>
8 src.ToDictionary(t => t.Item1, t => t.Item2);
9 public static Task<Dictionary<K, V>> ToDictionaryAsync<K, V>(
this IQuerySource<ValueTuple<K, V>> src, CancellationToken cancel =
default) where K : notnull =>
10 src.ToDictionaryAsync(t => t.Item1, t => t.Item2, cancel);
12 public static Dictionary<K, V> ToDictionary<K, V>(
this IQuerySource<ValueTuple<K, V>> src, IEqualityComparer<K>? comparer) where K : notnull =>
13 src.ToDictionary(t => t.Item1, t => t.Item2, comparer);
14 public static Task<Dictionary<K, V>> ToDictionaryAsync<K, V>(
this IQuerySource<ValueTuple<K, V>> src, IEqualityComparer<K>? comparer, CancellationToken cancel =
default) where K : notnull =>
15 src.ToDictionaryAsync(t => t.Item1, t => t.Item2, comparer, cancel);
18 public static Task<int> SumAsync(
this IQuerySource<int> src, CancellationToken cancel =
default) =>
19 src.SumAsync(x => x, cancel);
22 public static Task<long> SumAsync(
this IQuerySource<long> src, CancellationToken cancel =
default) =>
23 src.SumAsync(x => x, cancel);
26 public static Task<double> SumAsync(
this IQuerySource<double> src, CancellationToken cancel =
default) =>
27 src.SumAsync(x => x, cancel);
30 public static Task<double> AverageAsync(
this IQuerySource<double> src, CancellationToken cancel =
default) =>
31 src.AverageAsync(x => x, cancel);