AsyncEnumerable.AggregateBy Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Przeciążenia
AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,TAccumulate>, Func<TAccumulate, TSource,TAccumulate>, IEqualityComparer<TKey>)
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
Stosuje funkcję akumulacji w sekwencji, grupując wyniki według klucza.
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))
Parametry typu
- TSource
Typ elementów elementu source.
- TKey
Typ klucza zwróconego przez keySelector.
- TAccumulate
Typ wartości akumulatorowej.
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do agregowania.
- keySelector
- Func<TSource,TKey>
Funkcja wyodrębniania klucza dla każdego elementu.
- seedSelector
- Func<TKey,TAccumulate>
Fabryka początkowej wartości akumulatorowej.
- func
- Func<TAccumulate,TSource,TAccumulate>
Funkcja akumulowania, która ma być wywoływana dla każdego elementu.
- keyComparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy z.
Zwraca
Wyliczenie zawierające agregacje odpowiadające każdemu kluczowi pochodzącemu z sourceelementu .
Wyjątki
Parametr func ma wartość null.
Uwagi
Ta metoda jest porównywalna z metodami GroupBy, w których każde grupowanie jest agregowane w jedną wartość, w przeciwieństwie do przydzielania kolekcji dla każdej grupy.
Dotyczy
AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
Stosuje funkcję akumulacji w sekwencji, grupując wyniki według klucza.
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))
Parametry typu
- TSource
Typ elementów elementu source.
- TKey
Typ klucza zwróconego przez keySelector.
- TAccumulate
Typ wartości akumulatorowej.
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do agregowania.
- keySelector
- Func<TSource,TKey>
Funkcja wyodrębniania klucza dla każdego elementu.
- seed
- TAccumulate
Początkowa wartość akumulatorowa.
- func
- Func<TAccumulate,TSource,TAccumulate>
Funkcja akumulowania, która ma być wywoływana dla każdego elementu.
- keyComparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy z.
Zwraca
Wyliczenie zawierające agregacje odpowiadające każdemu kluczowi pochodzącemu z sourceelementu .
Wyjątki
Parametr func ma wartość null.
Uwagi
Ta metoda jest porównywalna z metodami GroupBy, w których każde grupowanie jest agregowane w jedną wartość, w przeciwieństwie do przydzielania kolekcji dla każdej grupy.
Dotyczy
AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, Func<TKey,CancellationToken, ValueTask<TAccumulate>>, Func<TAccumulate,TSource,CancellationToken, ValueTask<TAccumulate>>, IEqualityComparer<TKey>)
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
Stosuje funkcję akumulacji w sekwencji, grupując wyniki według klucza.
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))
Parametry typu
- TSource
Typ elementów elementu source.
- TKey
Typ klucza zwróconego przez keySelector.
- TAccumulate
Typ wartości akumulatorowej.
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do agregowania.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkcja wyodrębniania klucza dla każdego elementu.
- seedSelector
- Func<TKey,CancellationToken,ValueTask<TAccumulate>>
Fabryka początkowej wartości akumulatorowej.
- func
- Func<TAccumulate,TSource,CancellationToken,ValueTask<TAccumulate>>
Funkcja akumulowania, która ma być wywoływana dla każdego elementu.
- keyComparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy z.
Zwraca
Wyliczenie zawierające agregacje odpowiadające każdemu kluczowi pochodzącemu z sourceelementu .
Wyjątki
Parametr func ma wartość null.
Uwagi
Ta metoda jest porównywalna z metodami GroupBy, w których każde grupowanie jest agregowane w jedną wartość, w przeciwieństwie do przydzielania kolekcji dla każdej grupy.
Dotyczy
AggregateBy<TSource,TKey,TAccumulate>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, TAccumulate, Func<TAccumulate,TSource,CancellationToken,ValueTask<TAccumulate>>, IEqualityComparer<TKey>)
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
- Źródło:
- AggregateBy.cs
Stosuje funkcję akumulacji w sekwencji, grupując wyniki według klucza.
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))
Parametry typu
- TSource
Typ elementów elementu source.
- TKey
Typ klucza zwróconego przez keySelector.
- TAccumulate
Typ wartości akumulatorowej.
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do agregowania.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkcja wyodrębniania klucza dla każdego elementu.
- seed
- TAccumulate
Początkowa wartość akumulatorowa.
- func
- Func<TAccumulate,TSource,CancellationToken,ValueTask<TAccumulate>>
Funkcja akumulowania, która ma być wywoływana dla każdego elementu.
- keyComparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy z.
Zwraca
Wyliczenie zawierające agregacje odpowiadające każdemu kluczowi pochodzącemu z sourceelementu .
Wyjątki
Parametr func ma wartość null.
Uwagi
Ta metoda jest porównywalna z metodami GroupBy, w których każde grupowanie jest agregowane w jedną wartość, w przeciwieństwie do przydzielania kolekcji dla każdej grupy.