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

Definition

Namespace:

System.Linq

Assembly:

System.Linq.AsyncEnumerable.dll

Package:

System.Linq.AsyncEnumerable v10.0.0-preview.5.25277.114

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

ToLookupAsync<TSource,TKey,TElement>(IAsyncEnumerable, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer, CancellationToken) Creates a ILookup<TKey,TElement> from an IAsyncEnumerableaccording to a specified key selector function and element selector functions.
ToLookupAsync<TSource,TKey,TElement>(IAsyncEnumerable, Func<TSource,CancellationToken,ValueTask>, Func<TSource, CancellationToken,ValueTask>, IEqualityComparer, CancellationToken) Creates a ILookup<TKey,TElement> from an IAsyncEnumerableaccording to a specified key selector function and element selector functions.
ToLookupAsync<TSource,TKey>(IAsyncEnumerable, Func<TSource,CancellationToken,ValueTask>, IEqualityComparer, CancellationToken) Creates a ILookup<TKey,TElement> from an IAsyncEnumerableaccording to a specified key selector function.
ToLookupAsync<TSource,TKey>(IAsyncEnumerable, Func<TSource,TKey>, IEqualityComparer, CancellationToken) Creates a ILookup<TKey,TElement> from an IAsyncEnumerableaccording to a specified key selector function.

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

Source:

ToLookupAsync.cs

Source:

ToLookupAsync.cs

public static System.Threading.Tasks.ValueTask<System.Linq.ILookup<TKey,TElement>> ToLookupAsync<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, System.Threading.CancellationToken cancellationToken = default);
static member ToLookupAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Linq.ILookup<'Key, 'Element>>
<Extension()>
Public Function ToLookupAsync(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, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of ILookup(Of TKey, TElement))

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

TElement

The type of the value returned by elementSelector.

Parameters

keySelector

Func<TSource,TKey>

A function to extract a key from each element.

elementSelector

Func<TSource,TElement>

A transform function to produce a result element value from each element.

Returns

A ILookup<TKey,TElement> that contains keys and values.

Exceptions

Applies to

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

Source:

ToLookupAsync.cs

Source:

ToLookupAsync.cs

public static System.Threading.Tasks.ValueTask<System.Linq.ILookup<TKey,TElement>> ToLookupAsync<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, System.Threading.CancellationToken cancellationToken = default);
static member ToLookupAsync : 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.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Linq.ILookup<'Key, 'Element>>
<Extension()>
Public Function ToLookupAsync(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, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of ILookup(Of TKey, TElement))

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

TElement

The type of the value returned by elementSelector.

Parameters

Returns

A ILookup<TKey,TElement> that contains keys and values.

Exceptions

Applies to

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

Source:

ToLookupAsync.cs

Source:

ToLookupAsync.cs

public static System.Threading.Tasks.ValueTask<System.Linq.ILookup<TKey,TSource>> ToLookupAsync<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, System.Threading.CancellationToken cancellationToken = default);
static member ToLookupAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Linq.ILookup<'Key, 'Source>>
<Extension()>
Public Function ToLookupAsync(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), Optional comparer As IEqualityComparer(Of TKey) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of ILookup(Of TKey, TSource))

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

Parameters

Returns

A ILookup<TKey,TElement> that contains keys and values.

Exceptions

Applies to

ToLookupAsync<TSource,TKey>(IAsyncEnumerable, Func<TSource,TKey>, IEqualityComparer, CancellationToken)

Source:

ToLookupAsync.cs

Source:

ToLookupAsync.cs

public static System.Threading.Tasks.ValueTask<System.Linq.ILookup<TKey,TSource>> ToLookupAsync<TSource,TKey>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default, System.Threading.CancellationToken cancellationToken = default);
static member ToLookupAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Linq.ILookup<'Key, 'Source>>
<Extension()>
Public Function ToLookupAsync(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), Optional comparer As IEqualityComparer(Of TKey) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of ILookup(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 a key from each element.

Returns

A ILookup<TKey,TElement> that contains keys and values.

Exceptions

Applies to