AsyncEnumerable.GroupBy Method (System.Linq) (original) (raw)

Definition

Overloads

GroupBy<TSource,TKey,TElement,TResult>(IAsyncEnumerable, Func<TSource,CancellationToken,ValueTask>, Func<TSource, CancellationToken,ValueTask>, Func<TKey,IEnumerable, CancellationToken,ValueTask>, IEqualityComparer) Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.
GroupBy<TSource,TKey,TElement,TResult>(IAsyncEnumerable, Func<TSource,TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable, TResult>, IEqualityComparer) Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.
GroupBy<TSource,TKey,TElement>(IAsyncEnumerable, Func<TSource, CancellationToken,ValueTask>, Func<TSource,CancellationToken, ValueTask>, IEqualityComparer) Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
GroupBy<TSource,TKey,TElement>(IAsyncEnumerable, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer) Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
GroupBy<TSource,TKey,TResult>(IAsyncEnumerable, Func<TSource, CancellationToken,ValueTask>, Func<TKey,IEnumerable, CancellationToken,ValueTask>, IEqualityComparer) Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
GroupBy<TSource,TKey,TResult>(IAsyncEnumerable, Func<TSource,TKey>, Func<TKey,IEnumerable,TResult>, IEqualityComparer) Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
GroupBy<TSource,TKey>(IAsyncEnumerable, Func<TSource,CancellationToken,ValueTask>, IEqualityComparer) Groups the elements of a sequence according to a specified key selector function.
GroupBy<TSource,TKey>(IAsyncEnumerable, Func<TSource,TKey>, IEqualityComparer) Groups the elements of a sequence according to a specified key selector function.

GroupBy<TSource,TKey,TElement,TResult>(IAsyncEnumerable, Func<TSource,CancellationToken,ValueTask>, Func<TSource, CancellationToken,ValueTask>, Func<TKey,IEnumerable, CancellationToken,ValueTask>, IEqualityComparer)

Source:

GroupBy.cs

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.

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)

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

TResult

The type of the result value returned by resultSelector.

Parameters

Returns

A collection of elements of type TResult where each element represents a projection over a group and its key.

Exceptions

Applies to

GroupBy<TSource,TKey,TElement,TResult>(IAsyncEnumerable, Func<TSource,TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable, TResult>, IEqualityComparer)

Source:

GroupBy.cs

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.

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)

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

TResult

The type of the result value returned by resultSelector.

Parameters

keySelector

Func<TSource,TKey>

A function to extract the key for each element.

resultSelector

Func<TKey,IEnumerable,TResult>

A function to create a result value from each group.

Returns

A collection of elements of type TResult where each element represents a projection over a group and its key.

Exceptions

Applies to

GroupBy<TSource,TKey,TElement>(IAsyncEnumerable, Func<TSource, CancellationToken,ValueTask>, Func<TSource,CancellationToken, ValueTask>, IEqualityComparer)

Source:

GroupBy.cs

Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.

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))

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

Parameters

Returns

An IAsyncEnumerable where each IGrouping<TKey,TElement>contains a sequence of objects of type TElement and a key.

Exceptions

Applies to

GroupBy<TSource,TKey,TElement>(IAsyncEnumerable, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer)

Source:

GroupBy.cs

Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.

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))

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

Parameters

keySelector

Func<TSource,TKey>

A function to extract the key for each element.

Returns

An IAsyncEnumerable where each IGrouping<TKey,TElement>contains a sequence of objects of type TElement and a key.

Exceptions

Applies to

GroupBy<TSource,TKey,TResult>(IAsyncEnumerable, Func<TSource, CancellationToken,ValueTask>, Func<TKey,IEnumerable, CancellationToken,ValueTask>, IEqualityComparer)

Source:

GroupBy.cs

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.

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)

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

TResult

The type of the result value returned by resultSelector.

Parameters

Returns

A collection of elements of type TResult where each element represents a projection over a group and its key.

Exceptions

Applies to

GroupBy<TSource,TKey,TResult>(IAsyncEnumerable, Func<TSource,TKey>, Func<TKey,IEnumerable,TResult>, IEqualityComparer)

Source:

GroupBy.cs

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.

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)

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

TResult

The type of the result value returned by resultSelector.

Parameters

keySelector

Func<TSource,TKey>

A function to extract the key for each element.

resultSelector

Func<TKey,IEnumerable,TResult>

A function to create a result value from each group.

Returns

A collection of elements of type TResult where each element represents a projection over a group and its key.

Exceptions

Applies to

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

Source:

GroupBy.cs

Groups the elements of a sequence according to a specified key selector function.

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))

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

Parameters

Returns

An IAsyncEnumerable where each IGrouping<TKey,TElement>contains a sequence of objects and a key.

Exceptions

Applies to

GroupBy<TSource,TKey>(IAsyncEnumerable, Func<TSource,TKey>, IEqualityComparer)

Source:

GroupBy.cs

Groups the elements of a sequence according to a specified key selector function.

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))

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

Parameters

keySelector

Func<TSource,TKey>

A function to extract the key for each element.

Returns

An IAsyncEnumerable where each IGrouping<TKey,TElement>contains a sequence of objects and a key.

Exceptions

Applies to