AsyncEnumerable.AggregateBy Método

Definição

Sobrecargas

Nome Description
AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,TAccumulate>, Func<TAccumulate, TSource,TAccumulate>, IEqualityComparer<TKey>)

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, Func<TKey,CancellationToken, ValueTask<TAccumulate>>, Func<TAccumulate,TSource,CancellationToken, ValueTask<TAccumulate>>, IEqualityComparer<TKey>)

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, TAccumulate, Func<TAccumulate,TSource,CancellationToken,ValueTask<TAccumulate>>, IEqualityComparer<TKey>)

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,TAccumulate>, Func<TAccumulate, TSource,TAccumulate>, IEqualityComparer<TKey>)

Origem:
AggregateBy.cs
Origem:
AggregateBy.cs
Origem:
AggregateBy.cs

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

public static System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TAccumulate>> AggregateBy<TSource,TKey,TAccumulate>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TKey,TAccumulate> seedSelector, Func<TAccumulate,TSource,TAccumulate> func, System.Collections.Generic.IEqualityComparer<TKey>? keyComparer = default);
static member AggregateBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * Func<'Key, 'Accumulate> * Func<'Accumulate, 'Source, 'Accumulate> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Accumulate>>
<Extension()>
Public Function AggregateBy(Of TSource, TKey, TAccumulate) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), seedSelector As Func(Of TKey, TAccumulate), func As Func(Of TAccumulate, TSource, TAccumulate), Optional keyComparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of KeyValuePair(Of TKey, TAccumulate))

Parâmetros de tipo

TSource

O tipo dos elementos de source.

TKey

O tipo da chave retornada por keySelector.

TAccumulate

O tipo do valor acumulador.

Parâmetros

source
IAsyncEnumerable<TSource>

Um IAsyncEnumerable<T> para agregar.

keySelector
Func<TSource,TKey>

Uma função para extrair a chave para cada elemento.

seedSelector
Func<TKey,TAccumulate>

Uma fábrica para o valor inicial do acumulador.

func
Func<TAccumulate,TSource,TAccumulate>

Uma função de acumulador a ser invocada em cada elemento.

keyComparer
IEqualityComparer<TKey>

Uma IEqualityComparer<T> com a qual comparar chaves.

Retornos

IAsyncEnumerable<KeyValuePair<TKey,TAccumulate>>

Um enumerável que contém as agregações correspondentes a cada chave derivada de source.

Exceções

func é null.

Comentários

Esse método é comparável aos métodos GroupBy em que cada agrupamento está sendo agregado em um único valor em vez de alocar uma coleção para cada grupo.

Aplica-se a

AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

Origem:
AggregateBy.cs
Origem:
AggregateBy.cs
Origem:
AggregateBy.cs

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

public static System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TAccumulate>> AggregateBy<TSource,TKey,TAccumulate>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, TAccumulate seed, Func<TAccumulate,TSource,TAccumulate> func, System.Collections.Generic.IEqualityComparer<TKey>? keyComparer = default);
static member AggregateBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * 'Accumulate * Func<'Accumulate, 'Source, 'Accumulate> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Accumulate>>
<Extension()>
Public Function AggregateBy(Of TSource, TKey, TAccumulate) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), seed As TAccumulate, func As Func(Of TAccumulate, TSource, TAccumulate), Optional keyComparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of KeyValuePair(Of TKey, TAccumulate))

Parâmetros de tipo

TSource

O tipo dos elementos de source.

TKey

O tipo da chave retornada por keySelector.

TAccumulate

O tipo do valor acumulador.

Parâmetros

source
IAsyncEnumerable<TSource>

Um IAsyncEnumerable<T> para agregar.

keySelector
Func<TSource,TKey>

Uma função para extrair a chave para cada elemento.

seed
TAccumulate

O valor inicial do acumulador.

func
Func<TAccumulate,TSource,TAccumulate>

Uma função de acumulador a ser invocada em cada elemento.

keyComparer
IEqualityComparer<TKey>

Uma IEqualityComparer<T> com a qual comparar chaves.

Retornos

IAsyncEnumerable<KeyValuePair<TKey,TAccumulate>>

Um enumerável que contém as agregações correspondentes a cada chave derivada de source.

Exceções

func é null.

Comentários

Esse método é comparável aos métodos GroupBy em que cada agrupamento está sendo agregado em um único valor em vez de alocar uma coleção para cada grupo.

Aplica-se a

AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, Func<TKey,CancellationToken, ValueTask<TAccumulate>>, Func<TAccumulate,TSource,CancellationToken, ValueTask<TAccumulate>>, IEqualityComparer<TKey>)

Origem:
AggregateBy.cs
Origem:
AggregateBy.cs
Origem:
AggregateBy.cs

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

public static System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TAccumulate>> AggregateBy<TSource,TKey,TAccumulate>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TKey>> keySelector, Func<TKey,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TAccumulate>> seedSelector, Func<TAccumulate,TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TAccumulate>> func, System.Collections.Generic.IEqualityComparer<TKey>? keyComparer = default);
static member AggregateBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * Func<'Key, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Accumulate>> * Func<'Accumulate, 'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Accumulate>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Accumulate>>
<Extension()>
Public Function AggregateBy(Of TSource, TKey, TAccumulate) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), seedSelector As Func(Of TKey, CancellationToken, ValueTask(Of TAccumulate)), func As Func(Of TAccumulate, TSource, CancellationToken, ValueTask(Of TAccumulate)), Optional keyComparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of KeyValuePair(Of TKey, TAccumulate))

Parâmetros de tipo

TSource

O tipo dos elementos de source.

TKey

O tipo da chave retornada por keySelector.

TAccumulate

O tipo do valor acumulador.

Parâmetros

source
IAsyncEnumerable<TSource>

Um IAsyncEnumerable<T> para agregar.

keySelector
Func<TSource,CancellationToken,ValueTask<TKey>>

Uma função para extrair a chave para cada elemento.

seedSelector
Func<TKey,CancellationToken,ValueTask<TAccumulate>>

Uma fábrica para o valor inicial do acumulador.

func
Func<TAccumulate,TSource,CancellationToken,ValueTask<TAccumulate>>

Uma função de acumulador a ser invocada em cada elemento.

keyComparer
IEqualityComparer<TKey>

Uma IEqualityComparer<T> com a qual comparar chaves.

Retornos

IAsyncEnumerable<KeyValuePair<TKey,TAccumulate>>

Um enumerável que contém as agregações correspondentes a cada chave derivada de source.

Exceções

func é null.

Comentários

Esse método é comparável aos métodos GroupBy em que cada agrupamento está sendo agregado em um único valor em vez de alocar uma coleção para cada grupo.

Aplica-se a

AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, TAccumulate, Func<TAccumulate,TSource,CancellationToken,ValueTask<TAccumulate>>, IEqualityComparer<TKey>)

Origem:
AggregateBy.cs
Origem:
AggregateBy.cs
Origem:
AggregateBy.cs

Aplica uma função de acumulador em uma sequência, agrupando resultados por chave.

public static System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TAccumulate>> AggregateBy<TSource,TKey,TAccumulate>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TKey>> keySelector, TAccumulate seed, Func<TAccumulate,TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TAccumulate>> func, System.Collections.Generic.IEqualityComparer<TKey>? keyComparer = default);
static member AggregateBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * 'Accumulate * Func<'Accumulate, 'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Accumulate>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Accumulate>>
<Extension()>
Public Function AggregateBy(Of TSource, TKey, TAccumulate) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), seed As TAccumulate, func As Func(Of TAccumulate, TSource, CancellationToken, ValueTask(Of TAccumulate)), Optional keyComparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of KeyValuePair(Of TKey, TAccumulate))

Parâmetros de tipo

TSource

O tipo dos elementos de source.

TKey

O tipo da chave retornada por keySelector.

TAccumulate

O tipo do valor acumulador.

Parâmetros

source
IAsyncEnumerable<TSource>

Um IAsyncEnumerable<T> para agregar.

keySelector
Func<TSource,CancellationToken,ValueTask<TKey>>

Uma função para extrair a chave para cada elemento.

seed
TAccumulate

O valor inicial do acumulador.

func
Func<TAccumulate,TSource,CancellationToken,ValueTask<TAccumulate>>

Uma função de acumulador a ser invocada em cada elemento.

keyComparer
IEqualityComparer<TKey>

Uma IEqualityComparer<T> com a qual comparar chaves.

Retornos

IAsyncEnumerable<KeyValuePair<TKey,TAccumulate>>

Um enumerável que contém as agregações correspondentes a cada chave derivada de source.

Exceções

func é null.

Comentários

Esse método é comparável aos métodos GroupBy em que cada agrupamento está sendo agregado em um único valor em vez de alocar uma coleção para cada grupo.

Aplica-se a