AsyncEnumerable.ToDictionaryAsync Metoda

Definice

Přetížení

Name Description
ToDictionaryAsync<TKey,TValue>(IAsyncEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>, CancellationToken)

Dictionary<TKey,TValue> Vytvoří z podle zadaného IAsyncEnumerable<T> porovnávače klíčů.

ToDictionaryAsync<TKey,TValue>(IAsyncEnumerable<ValueTuple<TKey,TValue>>, IEqualityComparer<TKey>, CancellationToken)

Dictionary<TKey,TValue> Vytvoří z podle zadaného IAsyncEnumerable<T> porovnávače klíčů.

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

Dictionary<TKey,TValue> Vytvoří z "IAsyncEnumerable<T>/> podle zadaného selektoru klíčů a funkcí selektoru prvků.

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

Dictionary<TKey,TValue> Vytvoří z "IAsyncEnumerable<T>/> podle zadaného selektoru klíčů a funkcí selektoru prvků.

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

Vytvoří Dictionary<TKey,TValue> z IAsyncEnumerable<T> podle zadané funkce selektoru kláves.

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

Vytvoří Dictionary<TKey,TValue> z IAsyncEnumerable<T> podle zadané funkce selektoru kláves.

ToDictionaryAsync<TKey,TValue>(IAsyncEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>, CancellationToken)

Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs

Dictionary<TKey,TValue> Vytvoří z podle zadaného IAsyncEnumerable<T> porovnávače klíčů.

public static System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<TKey,TValue>> ToDictionaryAsync<TKey,TValue>(this System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default, System.Threading.CancellationToken cancellationToken = default);
static member ToDictionaryAsync : System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Value>> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<'Key, 'Value>>
<Extension()>
Public Function ToDictionaryAsync(Of TKey, TValue) (source As IAsyncEnumerable(Of KeyValuePair(Of TKey, TValue)), Optional comparer As IEqualityComparer(Of TKey) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Dictionary(Of TKey, TValue))

Parametry typu

TKey

Typ klíčů z prvků source

TValue

Typ hodnot z prvků source

Parametry

source
IAsyncEnumerable<KeyValuePair<TKey,TValue>>

The IAsyncEnumerable<T> to create a Dictionary<TKey,TValue> from.

comparer
IEqualityComparer<TKey>

Porovnávat IEqualityComparer<T> klíče.

cancellationToken
CancellationToken

Monitorování CancellationToken žádostí o zrušení Výchozí hodnota je None.

Návraty

ValueTask<Dictionary<TKey,TValue>>

A Dictionary<TKey,TValue> obsahující klíče a hodnoty z source.

Výjimky

source je null.

source obsahuje jeden nebo více duplicitních klíčů (prostřednictvím vrácené úlohy).

Platí pro

ToDictionaryAsync<TKey,TValue>(IAsyncEnumerable<ValueTuple<TKey,TValue>>, IEqualityComparer<TKey>, CancellationToken)

Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs

Dictionary<TKey,TValue> Vytvoří z podle zadaného IAsyncEnumerable<T> porovnávače klíčů.

public static System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<TKey,TValue>> ToDictionaryAsync<TKey,TValue>(this System.Collections.Generic.IAsyncEnumerable<(TKey Key, TValue Value)> source, System.Collections.Generic.IEqualityComparer<TKey>? comparer = default, System.Threading.CancellationToken cancellationToken = default);
static member ToDictionaryAsync : System.Collections.Generic.IAsyncEnumerable<ValueTuple<'Key, 'Value>> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<'Key, 'Value>>
<Extension()>
Public Function ToDictionaryAsync(Of TKey, TValue) (source As IAsyncEnumerable(Of ValueTuple(Of TKey, TValue)), Optional comparer As IEqualityComparer(Of TKey) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Dictionary(Of TKey, TValue))

Parametry typu

TKey

Typ klíčů z prvků source

TValue

Typ hodnot z prvků source

Parametry

source
IAsyncEnumerable<ValueTuple<TKey,TValue>>

The IAsyncEnumerable<T> to create a Dictionary<TKey,TValue> from.

comparer
IEqualityComparer<TKey>

Porovnávat IEqualityComparer<T> klíče.

cancellationToken
CancellationToken

Monitorování CancellationToken žádostí o zrušení Výchozí hodnota je None.

Návraty

ValueTask<Dictionary<TKey,TValue>>

A Dictionary<TKey,TValue> obsahující klíče a hodnoty z source.

Výjimky

source je null.

source obsahuje jeden nebo více duplicitních klíčů (prostřednictvím vrácené úlohy).

Platí pro

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

Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs

Dictionary<TKey,TValue> Vytvoří z "IAsyncEnumerable<T>/> podle zadaného selektoru klíčů a funkcí selektoru prvků.

public static System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<TKey,TElement>> ToDictionaryAsync<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 ToDictionaryAsync : 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.Collections.Generic.Dictionary<'Key, 'Element>>
<Extension()>
Public Function ToDictionaryAsync(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 Dictionary(Of TKey, TElement))

Parametry typu

TSource

Typ prvků zdroje.

TKey

Typ klíče vráceného keySelector.

TElement

Typ hodnoty vrácené elementSelectorhodnotou .

Parametry

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

Funkce, která extrahuje klíč z každého prvku.

elementSelector
Func<TSource,CancellationToken,ValueTask<TElement>>

Transformační funkce pro vytvoření hodnoty výsledného prvku z každého prvku.

comparer
IEqualityComparer<TKey>

Porovnávat IEqualityComparer<T> klíče.

cancellationToken
CancellationToken

Monitorování CancellationToken žádostí o zrušení Výchozí hodnota je None.

Návraty

ValueTask<Dictionary<TKey,TElement>>

A Dictionary<TKey,TValue> , který obsahuje hodnoty typu TElement vybrané ze vstupní sekvence.

Výjimky

elementSelector je null.

source obsahuje jeden nebo více duplicitních klíčů (prostřednictvím vrácené úlohy).

Platí pro

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

Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs

Dictionary<TKey,TValue> Vytvoří z "IAsyncEnumerable<T>/> podle zadaného selektoru klíčů a funkcí selektoru prvků.

public static System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<TKey,TElement>> ToDictionaryAsync<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 ToDictionaryAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<'Key, 'Element>>
<Extension()>
Public Function ToDictionaryAsync(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 Dictionary(Of TKey, TElement))

Parametry typu

TSource

Typ prvků zdroje.

TKey

Typ klíče vráceného keySelector.

TElement

Typ hodnoty vrácené elementSelectorhodnotou .

Parametry

keySelector
Func<TSource,TKey>

Funkce, která extrahuje klíč z každého prvku.

elementSelector
Func<TSource,TElement>

Transformační funkce pro vytvoření hodnoty výsledného prvku z každého prvku.

comparer
IEqualityComparer<TKey>

Porovnávat IEqualityComparer<T> klíče.

cancellationToken
CancellationToken

Monitorování CancellationToken žádostí o zrušení Výchozí hodnota je None.

Návraty

ValueTask<Dictionary<TKey,TElement>>

A Dictionary<TKey,TValue> , který obsahuje hodnoty typu TElement vybrané ze vstupní sekvence.

Výjimky

elementSelector je null.

source obsahuje jeden nebo více duplicitních klíčů (prostřednictvím vrácené úlohy).

Platí pro

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

Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs

Vytvoří Dictionary<TKey,TValue> z IAsyncEnumerable<T> podle zadané funkce selektoru kláves.

public static System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<TKey,TSource>> ToDictionaryAsync<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 ToDictionaryAsync : 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.Collections.Generic.Dictionary<'Key, 'Source>>
<Extension()>
Public Function ToDictionaryAsync(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 Dictionary(Of TKey, TSource))

Parametry typu

TSource

Typ prvků zdroje.

TKey

Typ klíčů vrácených uživatelem keySelector.

Parametry

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

Funkce, která extrahuje klíč z každého prvku.

comparer
IEqualityComparer<TKey>

Porovnávat IEqualityComparer<T> klíče.

cancellationToken
CancellationToken

Monitorování CancellationToken žádostí o zrušení Výchozí hodnota je None.

Návraty

ValueTask<Dictionary<TKey,TSource>>

A Dictionary<TKey,TValue> obsahující klíče a hodnoty.

Výjimky

keySelector je null.

source obsahuje jeden nebo více duplicitních klíčů (prostřednictvím vrácené úlohy).

Platí pro

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

Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs
Zdroj:
ToDictionaryAsync.cs

Vytvoří Dictionary<TKey,TValue> z IAsyncEnumerable<T> podle zadané funkce selektoru kláves.

public static System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<TKey,TSource>> ToDictionaryAsync<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 ToDictionaryAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<'Key, 'Source>>
<Extension()>
Public Function ToDictionaryAsync(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 Dictionary(Of TKey, TSource))

Parametry typu

TSource

Typ prvků zdroje.

TKey

Typ klíčů vrácených uživatelem keySelector.

Parametry

keySelector
Func<TSource,TKey>

Funkce, která extrahuje klíč z každého prvku.

comparer
IEqualityComparer<TKey>

Porovnávat IEqualityComparer<T> klíče.

cancellationToken
CancellationToken

Monitorování CancellationToken žádostí o zrušení Výchozí hodnota je None.

Návraty

ValueTask<Dictionary<TKey,TSource>>

A Dictionary<TKey,TValue> obsahující klíče a hodnoty.

Výjimky

keySelector je null.

source obsahuje jeden nebo více duplicitních klíčů (prostřednictvím vrácené úlohy).

Platí pro