|
|
@@ -11,16 +11,6 @@ namespace System.Linq
|
|
|
partial class AsyncEnumerable
|
|
|
{
|
|
|
#if SUPPORT_FLAT_ASYNC_API
|
|
|
- public static ValueTask<long?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<long?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<float?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<float?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<double?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<double?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<decimal?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<decimal?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<int> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<int>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<long> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<long>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<float> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<float>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<double> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<double>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<decimal> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<decimal>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<int?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<int?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
public static IAsyncEnumerable<TSource> TakeWhile<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<bool>> predicate) => TakeWhileAwaitCore<TSource>(source, predicate);
|
|
|
public static IAsyncEnumerable<TSource> TakeWhile<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, int, ValueTask<bool>> predicate) => TakeWhileAwaitCore<TSource>(source, predicate);
|
|
|
public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
|
|
|
@@ -36,16 +26,6 @@ namespace System.Linq
|
|
|
public static IAsyncEnumerable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncEnumerable<TFirst> first, IAsyncEnumerable<TSecond> second, Func<TFirst, TSecond, ValueTask<TResult>> selector) => ZipAwaitCore<TFirst, TSecond, TResult>(first, second, selector);
|
|
|
|
|
|
#if !NO_DEEP_CANCELLATION
|
|
|
- public static ValueTask<int?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<int?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<long?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<long?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<float?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<float?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<double?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<double?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<decimal?> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<decimal?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<int> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<int>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<long> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<long>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<float> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<float>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<double> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<double>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<decimal> SumAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<decimal>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
public static IAsyncEnumerable<TSource> TakeWhile<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<bool>> predicate) => TakeWhileAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
public static IAsyncEnumerable<TSource> TakeWhile<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, int, CancellationToken, ValueTask<bool>> predicate) => TakeWhileAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
|
|
|
@@ -61,126 +41,6 @@ namespace System.Linq
|
|
|
public static IAsyncEnumerable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncEnumerable<TFirst> first, IAsyncEnumerable<TSecond> second, Func<TFirst, TSecond, CancellationToken, ValueTask<TResult>> selector) => ZipAwaitWithCancellationCore<TFirst, TSecond, TResult>(first, second, selector);
|
|
|
#endif
|
|
|
#else
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="Nullable{Long}"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<long?> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<long?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="Nullable{Float}"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<float?> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<float?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="Nullable{Double}"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<double?> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<double?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="Nullable{Decimal}"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<decimal?> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<decimal?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="int"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<int> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<int>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="long"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<long> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<long>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="float"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<float> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<float>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="double"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<double> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<double>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="decimal"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<decimal> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<decimal>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Computes the sum of a sequence of <see cref="Nullable{Int}"/> values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">A sequence of values that are used to calculate a sum.</param>
|
|
|
- /// <param name="selector">An asynchronous transform function to apply to each element.</param>
|
|
|
- /// <param name="cancellationToken">The optional cancellation token to be used for cancelling the sequence at any time.</param>
|
|
|
- /// <returns>A ValueTask containing the sum of the values in the source sequence.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is <see langword="null"/>.</exception>
|
|
|
- /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
|
|
|
- public static ValueTask<int?> SumAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<int?>> selector, CancellationToken cancellationToken = default) => SumAwaitAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Returns elements from an async-enumerable sequence as long as a specified condition is true.
|
|
|
/// </summary>
|
|
|
@@ -352,16 +212,6 @@ namespace System.Linq
|
|
|
public static IAsyncEnumerable<TResult> ZipAwait<TFirst, TSecond, TResult>(this IAsyncEnumerable<TFirst> first, IAsyncEnumerable<TSecond> second, Func<TFirst, TSecond, ValueTask<TResult>> selector) => ZipAwaitCore<TFirst, TSecond, TResult>(first, second, selector);
|
|
|
|
|
|
#if !NO_DEEP_CANCELLATION
|
|
|
- public static ValueTask<int?> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<int?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<long?> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<long?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<float?> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<float?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<double?> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<double?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<decimal?> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<decimal?>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<int> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<int>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<long> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<long>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<float> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<float>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<double> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<double>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
- public static ValueTask<decimal> SumAwaitWithCancellationAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<decimal>> selector, CancellationToken cancellationToken = default) => SumAwaitWithCancellationAsyncCore<TSource>(source, selector, cancellationToken);
|
|
|
public static IAsyncEnumerable<TSource> TakeWhileAwaitWithCancellation<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<bool>> predicate) => TakeWhileAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
public static IAsyncEnumerable<TSource> TakeWhileAwaitWithCancellation<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, int, CancellationToken, ValueTask<bool>> predicate) => TakeWhileAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
|