diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.cs index 56a2e334..825454e8 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.cs @@ -11,16 +11,6 @@ namespace System.Linq partial class AsyncEnumerable { #if SUPPORT_FLAT_ASYNC_API - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); public static ValueTask CountAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => CountAwaitAsyncCore(source, predicate, cancellationToken); public static ValueTask FirstAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => FirstAwaitAsyncCore(source, predicate, cancellationToken); public static ValueTask FirstOrDefaultAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => FirstOrDefaultAwaitAsyncCore(source, predicate, cancellationToken); @@ -106,16 +96,6 @@ namespace System.Linq public static IAsyncEnumerable Zip(this IAsyncEnumerable first, IAsyncEnumerable second, Func> selector) => ZipAwaitCore(first, second, selector); #if !NO_DEEP_CANCELLATION - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); public static ValueTask CountAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => CountAwaitWithCancellationAsyncCore(source, predicate, cancellationToken); public static ValueTask FirstAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => FirstAwaitWithCancellationAsyncCore(source, predicate, cancellationToken); public static ValueTask FirstOrDefaultAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => FirstOrDefaultAwaitWithCancellationAsyncCore(source, predicate, cancellationToken); @@ -201,131 +181,6 @@ namespace System.Linq public static IAsyncEnumerable Zip(this IAsyncEnumerable first, IAsyncEnumerable second, Func> selector) => ZipAwaitWithCancellationCore(first, second, selector); #endif #else - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values. - /// or is . - /// The source sequence is empty. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values. - /// or is . - /// The source sequence is empty. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values. - /// or is . - /// The source sequence is empty. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values. - /// or is . - /// The source sequence is empty. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values. - /// or is . - /// The source sequence is empty. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - - /// - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// An async-enumerable sequence of values to compute the average of. - /// A transform function to invoke and await on each element of the source sequence. - /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. - public static ValueTask AverageAwaitAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitAsyncCore(source, selector, cancellationToken); - /// /// Counts the elements in an async-enumerable sequence that satisfy a condition. /// @@ -1284,16 +1139,6 @@ namespace System.Linq public static IAsyncEnumerable ZipAwait(this IAsyncEnumerable first, IAsyncEnumerable second, Func> selector) => ZipAwaitCore(first, second, selector); #if !NO_DEEP_CANCELLATION - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); - public static ValueTask AverageAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) => AverageAwaitWithCancellationAsyncCore(source, selector, cancellationToken); public static ValueTask CountAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => CountAwaitWithCancellationAsyncCore(source, predicate, cancellationToken); public static ValueTask FirstAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => FirstAwaitWithCancellationAsyncCore(source, predicate, cancellationToken); public static ValueTask FirstOrDefaultAwaitWithCancellationAsync(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) => FirstOrDefaultAwaitWithCancellationAsyncCore(source, predicate, cancellationToken); diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs index 7aff63e0..abc41a54 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs @@ -95,7 +95,19 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values. + /// or is . + /// The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -130,7 +142,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -250,7 +263,19 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values. + /// or is . + /// The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -285,7 +310,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -405,7 +431,19 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values. + /// or is . + /// The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -440,7 +478,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -560,7 +599,19 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values. + /// or is . + /// The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -595,7 +646,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -715,7 +767,19 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values. + /// or is . + /// The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -750,7 +814,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -886,7 +951,18 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// or is . + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -929,7 +1005,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1073,7 +1150,18 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// or is . + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1116,7 +1204,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1260,7 +1349,18 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// or is . + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1303,7 +1403,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1447,7 +1548,18 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// or is . + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1490,7 +1602,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1634,7 +1747,18 @@ namespace System.Linq } } - internal static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// or is . + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -1677,7 +1801,8 @@ namespace System.Linq } #if !NO_DEEP_CANCELLATION - internal static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + private static ValueTask AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source));