AsyncEnumerable.ToDictionaryAsync 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
ToDictionaryAsync<TKey,TValue>(IAsyncEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>, CancellationToken)
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
Tworzy element Dictionary<TKey,TValue> na podstawie określonego modułu IAsyncEnumerable<T> porównania kluczy.
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 kluczy z elementów elementu source
- TValue
Typ wartości z elementów elementu source
Parametry
- source
- IAsyncEnumerable<KeyValuePair<TKey,TValue>>
Element IAsyncEnumerable<T> do utworzenia elementu Dictionary<TKey,TValue> na podstawie.
- comparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy.
- cancellationToken
- CancellationToken
Element CancellationToken do monitorowania żądań anulowania. Wartość domyślna to None.
Zwraca
Element Dictionary<TKey,TValue> zawierający klucze i wartości z sourceelementu .
Wyjątki
Parametr source ma wartość null.
source zawiera co najmniej jeden zduplikowany klucz (za pośrednictwem zwróconego zadania).
Dotyczy
ToDictionaryAsync<TKey,TValue>(IAsyncEnumerable<ValueTuple<TKey,TValue>>, IEqualityComparer<TKey>, CancellationToken)
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
Tworzy element Dictionary<TKey,TValue> na podstawie określonego modułu IAsyncEnumerable<T> porównania kluczy.
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 kluczy z elementów elementu source
- TValue
Typ wartości z elementów elementu source
Parametry
- source
- IAsyncEnumerable<ValueTuple<TKey,TValue>>
Element IAsyncEnumerable<T> do utworzenia elementu Dictionary<TKey,TValue> na podstawie.
- comparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy.
- cancellationToken
- CancellationToken
Element CancellationToken do monitorowania żądań anulowania. Wartość domyślna to None.
Zwraca
Element Dictionary<TKey,TValue> zawierający klucze i wartości z sourceelementu .
Wyjątki
Parametr source ma wartość null.
source zawiera co najmniej jeden zduplikowany klucz (za pośrednictwem zwróconego zadania).
Dotyczy
ToDictionaryAsync<TSource,TKey,TElement>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, Func<TSource, CancellationToken,ValueTask<TElement>>, IEqualityComparer<TKey>, CancellationToken)
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
Tworzy element Dictionary<TKey,TValue> z IAsyncEnumerable<T>"/> zgodnie z określonymi funkcjami selektora kluczy i selektora elementów.
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 elementów źródła.
- TKey
Typ klucza zwróconego przez keySelector.
- TElement
Typ wartości zwracanej przez elementSelector.
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do utworzenia Dictionary<TKey,TValue> elementu na podstawie.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkcja wyodrębniania klucza z każdego elementu.
- elementSelector
- Func<TSource,CancellationToken,ValueTask<TElement>>
Funkcja transform w celu wygenerowania wartości elementu wyniku z każdego elementu.
- comparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy.
- cancellationToken
- CancellationToken
Element CancellationToken do monitorowania żądań anulowania. Wartość domyślna to None.
Zwraca
Element Dictionary<TKey,TValue> zawierający wartości typu TElement wybranego z sekwencji danych wejściowych.
Wyjątki
Parametr elementSelector ma wartość null.
source zawiera co najmniej jeden zduplikowany klucz (za pośrednictwem zwróconego zadania).
Dotyczy
ToDictionaryAsync<TSource,TKey,TElement>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>, CancellationToken)
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
Tworzy element Dictionary<TKey,TValue> z IAsyncEnumerable<T>"/> zgodnie z określonymi funkcjami selektora kluczy i selektora elementów.
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 elementów źródła.
- TKey
Typ klucza zwróconego przez keySelector.
- TElement
Typ wartości zwracanej przez elementSelector.
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do utworzenia Dictionary<TKey,TValue> elementu na podstawie.
- keySelector
- Func<TSource,TKey>
Funkcja wyodrębniania klucza z każdego elementu.
- elementSelector
- Func<TSource,TElement>
Funkcja transform w celu wygenerowania wartości elementu wyniku z każdego elementu.
- comparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy.
- cancellationToken
- CancellationToken
Element CancellationToken do monitorowania żądań anulowania. Wartość domyślna to None.
Zwraca
Element Dictionary<TKey,TValue> zawierający wartości typu TElement wybranego z sekwencji danych wejściowych.
Wyjątki
Parametr elementSelector ma wartość null.
source zawiera co najmniej jeden zduplikowany klucz (za pośrednictwem zwróconego zadania).
Dotyczy
ToDictionaryAsync<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource, CancellationToken,ValueTask<TKey>>, IEqualityComparer<TKey>, CancellationToken)
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
Tworzy Dictionary<TKey,TValue> na podstawie IAsyncEnumerable<T> zgodnie z określoną funkcją selektora kluczy.
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 elementów źródła.
- TKey
Typ kluczy zwracanych przez keySelectorelement .
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do utworzenia Dictionary<TKey,TValue> elementu na podstawie.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Funkcja wyodrębniania klucza z każdego elementu.
- comparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy.
- cancellationToken
- CancellationToken
Element CancellationToken do monitorowania żądań anulowania. Wartość domyślna to None.
Zwraca
Element Dictionary<TKey,TValue> zawierający klucze i wartości.
Wyjątki
Parametr keySelector ma wartość null.
source zawiera co najmniej jeden zduplikowany klucz (za pośrednictwem zwróconego zadania).
Dotyczy
ToDictionaryAsync<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>, CancellationToken)
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
- Źródło:
- ToDictionaryAsync.cs
Tworzy Dictionary<TKey,TValue> na podstawie IAsyncEnumerable<T> zgodnie z określoną funkcją selektora kluczy.
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 elementów źródła.
- TKey
Typ kluczy zwracanych przez keySelectorelement .
Parametry
- source
- IAsyncEnumerable<TSource>
Element IAsyncEnumerable<T> do utworzenia Dictionary<TKey,TValue> elementu na podstawie.
- keySelector
- Func<TSource,TKey>
Funkcja wyodrębniania klucza z każdego elementu.
- comparer
- IEqualityComparer<TKey>
Element IEqualityComparer<T> do porównywania kluczy.
- cancellationToken
- CancellationToken
Element CancellationToken do monitorowania żądań anulowania. Wartość domyślna to None.
Zwraca
Element Dictionary<TKey,TValue> zawierający klucze i wartości.
Wyjątki
Parametr keySelector ma wartość null.
source zawiera co najmniej jeden zduplikowany klucz (za pośrednictwem zwróconego zadania).