AsyncEnumerable.GroupBy Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
GroupBy<TSource,TKey,TElement,TResult>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, Func<TSource, CancellationToken,ValueTask<TElement>>, Func<TKey,IEnumerable<TElement>, CancellationToken,ValueTask<TResult>>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle zadané funkce selektoru klíčů a vytvoří výslednou hodnotu z každé skupiny a jejího klíče. Hodnoty klíče se porovnávají pomocí zadaného porovnávače a prvky každé skupiny se promítnou pomocí zadané funkce.
public static System.Collections.Generic.IAsyncEnumerable<TResult> GroupBy<TSource,TKey,TElement,TResult>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TKey>> keySelector, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TElement>> elementSelector, Func<TKey,System.Collections.Generic.IEnumerable<TElement>,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Element>> * Func<'Key, seq<'Element>, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Result>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<'Result>
<Extension()>
Public Function GroupBy(Of TSource, TKey, TElement, TResult) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), elementSelector As Func(Of TSource, CancellationToken, ValueTask(Of TElement)), resultSelector As Func(Of TKey, IEnumerable(Of TElement), CancellationToken, ValueTask(Of TResult)), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of TResult)
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
- TElement
Typ prvků v každém IGrouping<TKey,TElement>.
- TResult
Typ výsledné hodnoty vrácené resultSelectorhodnotou .
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkce, která extrahuje klíč pro každý prvek.
- elementSelector
- Func<TSource,CancellationToken,ValueTask<TElement>>
Funkce pro mapování každého zdrojového prvku na prvek v objektu IGrouping<TKey,TElement>.
- resultSelector
- Func<TKey,IEnumerable<TElement>,CancellationToken,ValueTask<TResult>>
Funkce, která vytvoří výslednou hodnotu z každé skupiny.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kolekce prvků typu TResult , kde každý prvek představuje projekci nad skupinou a jeho klíčem.
Výjimky
resultSelector je null.
Platí pro
GroupBy<TSource,TKey,TElement,TResult>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle zadané funkce selektoru klíčů a vytvoří výslednou hodnotu z každé skupiny a jejího klíče. Hodnoty klíče se porovnávají pomocí zadaného porovnávače a prvky každé skupiny se promítnou pomocí zadané funkce.
public static System.Collections.Generic.IAsyncEnumerable<TResult> GroupBy<TSource,TKey,TElement,TResult>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, Func<TKey,System.Collections.Generic.IEnumerable<TElement>,TResult> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * Func<'Key, seq<'Element>, 'Result> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<'Result>
<Extension()>
Public Function GroupBy(Of TSource, TKey, TElement, TResult) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement), resultSelector As Func(Of TKey, IEnumerable(Of TElement), TResult), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of TResult)
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
- TElement
Typ prvků v každém IGrouping<TKey,TElement>.
- TResult
Typ výsledné hodnoty vrácené resultSelectorhodnotou .
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,TKey>
Funkce, která extrahuje klíč pro každý prvek.
- elementSelector
- Func<TSource,TElement>
Funkce pro mapování každého zdrojového prvku na prvek v objektu IGrouping<TKey,TElement>.
- resultSelector
- Func<TKey,IEnumerable<TElement>,TResult>
Funkce, která vytvoří výslednou hodnotu z každé skupiny.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kolekce prvků typu TResult , kde každý prvek představuje projekci nad skupinou a jeho klíčem.
Výjimky
resultSelector je null.
Platí pro
GroupBy<TSource,TKey,TElement>(IAsyncEnumerable<TSource>, Func<TSource, CancellationToken,ValueTask<TKey>>, Func<TSource,CancellationToken, ValueTask<TElement>>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle funkce selektoru klíče. Klíče se porovnávají pomocí porovnávače a jednotlivé prvky skupiny se promítají pomocí zadané funkce.
public static System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<TKey,TElement>> GroupBy<TSource,TKey,TElement>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TKey>> keySelector, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TElement>> elementSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Element>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<'Key, 'Element>>
<Extension()>
Public Function GroupBy(Of TSource, TKey, TElement) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), elementSelector As Func(Of TSource, CancellationToken, ValueTask(Of TElement)), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of IGrouping(Of TKey, TElement))
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
- TElement
Typ prvků v souboru IGrouping<TKey,TElement>.
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkce, která extrahuje klíč pro každý prvek.
- elementSelector
- Func<TSource,CancellationToken,ValueTask<TElement>>
Funkce pro mapování každého zdrojového prvku na prvek v objektu IGrouping<TKey,TElement>.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kde IAsyncEnumerable<T> každý IGrouping<TKey,TElement> obsahuje posloupnost objektů typu TElement a klíče.
Výjimky
elementSelector je null.
Platí pro
GroupBy<TSource,TKey,TElement>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle funkce selektoru klíče. Klíče se porovnávají pomocí porovnávače a jednotlivé prvky skupiny se promítají pomocí zadané funkce.
public static System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<TKey,TElement>> GroupBy<TSource,TKey,TElement>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<'Key, 'Element>>
<Extension()>
Public Function GroupBy(Of TSource, TKey, TElement) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of IGrouping(Of TKey, TElement))
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
- TElement
Typ prvků v souboru IGrouping<TKey,TElement>.
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,TKey>
Funkce, která extrahuje klíč pro každý prvek.
- elementSelector
- Func<TSource,TElement>
Funkce pro mapování každého zdrojového prvku na prvek v objektu IGrouping<TKey,TElement>.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kde IAsyncEnumerable<T> každý IGrouping<TKey,TElement> obsahuje posloupnost objektů typu TElement a klíče.
Výjimky
elementSelector je null.
Platí pro
GroupBy<TSource,TKey,TResult>(IAsyncEnumerable<TSource>, Func<TSource, CancellationToken,ValueTask<TKey>>, Func<TKey,IEnumerable<TSource>, CancellationToken,ValueTask<TResult>>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle zadané funkce selektoru klíčů a vytvoří výslednou hodnotu z každé skupiny a jejího klíče.
public static System.Collections.Generic.IAsyncEnumerable<TResult> GroupBy<TSource,TKey,TResult>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TKey>> keySelector, Func<TKey,System.Collections.Generic.IEnumerable<TSource>,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * Func<'Key, seq<'Source>, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Result>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<'Result>
<Extension()>
Public Function GroupBy(Of TSource, TKey, TResult) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), resultSelector As Func(Of TKey, IEnumerable(Of TSource), CancellationToken, ValueTask(Of TResult)), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of TResult)
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
- TResult
Typ výsledné hodnoty vrácené parametrem resultSelector.
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkce, která extrahuje klíč pro každý prvek.
- resultSelector
- Func<TKey,IEnumerable<TSource>,CancellationToken,ValueTask<TResult>>
Funkce, která vytvoří výslednou hodnotu z každé skupiny.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kolekce prvků typu TResult , kde každý prvek představuje projekci nad skupinou a jeho klíčem.
Výjimky
resultSelector je null.
Platí pro
GroupBy<TSource,TKey,TResult>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle zadané funkce selektoru klíčů a vytvoří výslednou hodnotu z každé skupiny a jejího klíče.
public static System.Collections.Generic.IAsyncEnumerable<TResult> GroupBy<TSource,TKey,TResult>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TKey,System.Collections.Generic.IEnumerable<TSource>,TResult> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * Func<'Key, seq<'Source>, 'Result> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<'Result>
<Extension()>
Public Function GroupBy(Of TSource, TKey, TResult) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), resultSelector As Func(Of TKey, IEnumerable(Of TSource), TResult), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of TResult)
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
- TResult
Typ výsledné hodnoty vrácené parametrem resultSelector.
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,TKey>
Funkce, která extrahuje klíč pro každý prvek.
- resultSelector
- Func<TKey,IEnumerable<TSource>,TResult>
Funkce, která vytvoří výslednou hodnotu z každé skupiny.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kolekce prvků typu TResult , kde každý prvek představuje projekci nad skupinou a jeho klíčem.
Výjimky
resultSelector je null.
Platí pro
GroupBy<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle zadané funkce selektoru klíče.
public static System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<TKey,TSource>> GroupBy<TSource,TKey>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<'Key, 'Source>>
<Extension()>
Public Function GroupBy(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of IGrouping(Of TKey, TSource))
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkce, která extrahuje klíč pro každý prvek.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kde IAsyncEnumerable<T> každý IGrouping<TKey,TElement> obsahuje posloupnost objektů a klíč.
Výjimky
keySelector je null.
Platí pro
GroupBy<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
- Zdroj:
- GroupBy.cs
Seskupí prvky sekvence podle zadané funkce selektoru klíče.
public static System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<TKey,TSource>> GroupBy<TSource,TKey>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default);
static member GroupBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.IAsyncEnumerable<System.Linq.IGrouping<'Key, 'Source>>
<Extension()>
Public Function GroupBy(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), Optional comparer As IEqualityComparer(Of TKey) = Nothing) As IAsyncEnumerable(Of IGrouping(Of TKey, TSource))
Parametry typu
- TSource
Typ prvků zdroje.
- TKey
Typ klíče vráceného keySelector.
Parametry
- source
- IAsyncEnumerable<TSource>
Prvek IAsyncEnumerable<T> , který se má seskupit.
- keySelector
- Func<TSource,TKey>
Funkce, která extrahuje klíč pro každý prvek.
- comparer
- IEqualityComparer<TKey>
Porovnávat IEqualityComparer<T> klíče.
Návraty
Kde IAsyncEnumerable<T> každý IGrouping<TKey,TElement> obsahuje posloupnost objektů a klíč.
Výjimky
keySelector je null.