AsyncEnumerable.AggregateAsync Method (System.Linq) (original) (raw)
Definition
Overloads
AggregateAsync<TSource,TAccumulate,TResult>(IAsyncEnumerable, TAccumulate, Func<TAccumulate,TSource,CancellationToken,ValueTask>, Func<TAccumulate,CancellationToken,ValueTask>, CancellationToken)
Source:
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
public static System.Threading.Tasks.ValueTask<TResult> AggregateAsync<TSource,TAccumulate,TResult>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate,TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TAccumulate>> func, Func<TAccumulate,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TResult>> resultSelector, System.Threading.CancellationToken cancellationToken = default);
static member AggregateAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * 'Accumulate * Func<'Accumulate, 'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Accumulate>> * Func<'Accumulate, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Result>> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Result>
<Extension()>
Public Function AggregateAsync(Of TSource, TAccumulate, TResult) (source As IAsyncEnumerable(Of TSource), seed As TAccumulate, func As Func(Of TAccumulate, TSource, CancellationToken, ValueTask(Of TAccumulate)), resultSelector As Func(Of TAccumulate, CancellationToken, ValueTask(Of TResult)), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TResult)
Type Parameters
TSource
The type of the elements of source.
TAccumulate
The type of the accumulator value.
TResult
The type of the resulting value.
Parameters
seed
TAccumulate
The initial accumulator value.
Returns
The transformed final accumulator value.
Exceptions
Applies to
AggregateAsync<TSource,TAccumulate,TResult>(IAsyncEnumerable, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, Func<TAccumulate, TResult>, CancellationToken)
Source:
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
public static System.Threading.Tasks.ValueTask<TResult> AggregateAsync<TSource,TAccumulate,TResult>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate,TSource,TAccumulate> func, Func<TAccumulate,TResult> resultSelector, System.Threading.CancellationToken cancellationToken = default);
static member AggregateAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * 'Accumulate * Func<'Accumulate, 'Source, 'Accumulate> * Func<'Accumulate, 'Result> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Result>
<Extension()>
Public Function AggregateAsync(Of TSource, TAccumulate, TResult) (source As IAsyncEnumerable(Of TSource), seed As TAccumulate, func As Func(Of TAccumulate, TSource, TAccumulate), resultSelector As Func(Of TAccumulate, TResult), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TResult)
Type Parameters
TSource
The type of the elements of source.
TAccumulate
The type of the accumulator value.
TResult
The type of the resulting value.
Parameters
seed
TAccumulate
The initial accumulator value.
func
Func<TAccumulate,TSource,TAccumulate>
An accumulator function to be invoked on each element.
resultSelector
Func<TAccumulate,TResult>
A function to transform the final accumulator value into the result value.
Returns
The transformed final accumulator value.
Exceptions
Applies to
AggregateAsync<TSource,TAccumulate>(IAsyncEnumerable, TAccumulate, Func<TAccumulate,TSource,CancellationToken,ValueTask>, CancellationToken)
Source:
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.
public static System.Threading.Tasks.ValueTask<TAccumulate> AggregateAsync<TSource,TAccumulate>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate,TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TAccumulate>> func, System.Threading.CancellationToken cancellationToken = default);
static member AggregateAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * 'Accumulate * Func<'Accumulate, 'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Accumulate>> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Accumulate>
<Extension()>
Public Function AggregateAsync(Of TSource, TAccumulate) (source As IAsyncEnumerable(Of TSource), seed As TAccumulate, func As Func(Of TAccumulate, TSource, CancellationToken, ValueTask(Of TAccumulate)), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TAccumulate)
Type Parameters
TSource
The type of the elements of source.
TAccumulate
The type of the accumulator value.
Parameters
seed
TAccumulate
The initial accumulator value.
Returns
The final accumulator value.
Exceptions
Applies to
AggregateAsync<TSource,TAccumulate>(IAsyncEnumerable, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, CancellationToken)
Source:
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.
public static System.Threading.Tasks.ValueTask<TAccumulate> AggregateAsync<TSource,TAccumulate>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate,TSource,TAccumulate> func, System.Threading.CancellationToken cancellationToken = default);
static member AggregateAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * 'Accumulate * Func<'Accumulate, 'Source, 'Accumulate> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Accumulate>
<Extension()>
Public Function AggregateAsync(Of TSource, TAccumulate) (source As IAsyncEnumerable(Of TSource), seed As TAccumulate, func As Func(Of TAccumulate, TSource, TAccumulate), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TAccumulate)
Type Parameters
TSource
The type of the elements of source.
TAccumulate
The type of the accumulator value.
Parameters
seed
TAccumulate
The initial accumulator value.
func
Func<TAccumulate,TSource,TAccumulate>
An accumulator function to be invoked on each element.
Returns
The final accumulator value.
Exceptions
Applies to
AggregateAsync(IAsyncEnumerable, Func<TSource,TSource,CancellationToken,ValueTask>, CancellationToken)
Source:
Applies an accumulator function over a sequence.
public static System.Threading.Tasks.ValueTask<TSource> AggregateAsync<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TSource>> func, System.Threading.CancellationToken cancellationToken = default);
static member AggregateAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Source>> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Source>
<Extension()>
Public Function AggregateAsync(Of TSource) (source As IAsyncEnumerable(Of TSource), func As Func(Of TSource, TSource, CancellationToken, ValueTask(Of TSource)), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TSource)
Type Parameters
TSource
The type of the elements of source.
Parameters
Returns
The final accumulator value.
Exceptions
source
contains no elements.
Applies to
AggregateAsync(IAsyncEnumerable, Func<TSource,TSource,TSource>, CancellationToken)
Source:
Applies an accumulator function over a sequence.
public static System.Threading.Tasks.ValueTask<TSource> AggregateAsync<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TSource,TSource> func, System.Threading.CancellationToken cancellationToken = default);
static member AggregateAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Source, 'Source> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Source>
<Extension()>
Public Function AggregateAsync(Of TSource) (source As IAsyncEnumerable(Of TSource), func As Func(Of TSource, TSource, TSource), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TSource)
Type Parameters
TSource
The type of the elements of source.
Parameters
func
Func<TSource,TSource,TSource>
An accumulator function to be invoked on each element.
Returns
The final accumulator value.
Exceptions
source
contains no elements.