AsyncEnumerable.ToDictionaryAsync Methode

Definition

Überlädt

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

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T> angegebenen Schlüsselvergleicher.

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

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T> angegebenen Schlüsselvergleicher.

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

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T>"/> entsprechend den angegebenen Schlüsselmarkierer- und Elementauswahlfunktionen.

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

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T>"/> entsprechend den angegebenen Schlüsselmarkierer- und Elementauswahlfunktionen.

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

Erstellt eine Dictionary<TKey,TValue> aus einer IAsyncEnumerable<T> gemäß einer angegebenen Schlüsselauswahlfunktion.

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

Erstellt eine Dictionary<TKey,TValue> aus einer IAsyncEnumerable<T> gemäß einer angegebenen Schlüsselauswahlfunktion.

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

Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T> angegebenen Schlüsselvergleicher.

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

Typparameter

TKey

Der Typ der Schlüssel aus Elementen von source

TValue

Der Typ der Werte aus Elementen von source

Parameter

source
IAsyncEnumerable<KeyValuePair<TKey,TValue>>

Der IAsyncEnumerable<T> zu erstellende Aus Dictionary<TKey,TValue> .

comparer
IEqualityComparer<TKey>

Eine IEqualityComparer<T> zum Vergleichen von Schlüsseln.

cancellationToken
CancellationToken

Der CancellationToken zu überwachende Monitor für Abbruchanforderungen. Der Standardwert lautet None.

Gibt zurück

ValueTask<Dictionary<TKey,TValue>>

A Dictionary<TKey,TValue> , das Schlüssel und Werte aus source.

Ausnahmen

source ist null.

source enthält mindestens einen doppelten Schlüssel (über die zurückgegebene Aufgabe).

Gilt für:

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

Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T> angegebenen Schlüsselvergleicher.

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

Typparameter

TKey

Der Typ der Schlüssel aus Elementen von source

TValue

Der Typ der Werte aus Elementen von source

Parameter

source
IAsyncEnumerable<ValueTuple<TKey,TValue>>

Der IAsyncEnumerable<T> zu erstellende Aus Dictionary<TKey,TValue> .

comparer
IEqualityComparer<TKey>

Eine IEqualityComparer<T> zum Vergleichen von Schlüsseln.

cancellationToken
CancellationToken

Der CancellationToken zu überwachende Monitor für Abbruchanforderungen. Der Standardwert lautet None.

Gibt zurück

ValueTask<Dictionary<TKey,TValue>>

A Dictionary<TKey,TValue> , das Schlüssel und Werte aus source.

Ausnahmen

source ist null.

source enthält mindestens einen doppelten Schlüssel (über die zurückgegebene Aufgabe).

Gilt für:

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

Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T>"/> entsprechend den angegebenen Schlüsselmarkierer- und Elementauswahlfunktionen.

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

Typparameter

TSource

Der Typ der Quellelemente.

TKey

Der Typ des keySelectorvon .

TElement

Der Typ des von elementSelector.

Parameter

source
IAsyncEnumerable<TSource>

Ein IAsyncEnumerable<T> , aus dem ein Element Dictionary<TKey,TValue> erstellt werden soll.

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

Eine Funktion zum Extrahieren eines Schlüssels aus jedem Element.

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

Eine Transformationsfunktion, um einen Ergebniselementwert aus jedem Element zu erzeugen.

comparer
IEqualityComparer<TKey>

Eine IEqualityComparer<T> zum Vergleichen von Schlüsseln.

cancellationToken
CancellationToken

Der CancellationToken zu überwachende Monitor für Abbruchanforderungen. Der Standardwert lautet None.

Gibt zurück

ValueTask<Dictionary<TKey,TElement>>

Ein Dictionary<TKey,TValue> Wert, der Werte vom Typ TElement enthält, die aus der Eingabesequenz ausgewählt sind.

Ausnahmen

elementSelector ist null.

source enthält mindestens einen doppelten Schlüssel (über die zurückgegebene Aufgabe).

Gilt für:

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

Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs

Erstellt eine Dictionary<TKey,TValue> aus einem IAsyncEnumerable<T>"/> entsprechend den angegebenen Schlüsselmarkierer- und Elementauswahlfunktionen.

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

Typparameter

TSource

Der Typ der Quellelemente.

TKey

Der Typ des keySelectorvon .

TElement

Der Typ des von elementSelector.

Parameter

source
IAsyncEnumerable<TSource>

Ein IAsyncEnumerable<T> , aus dem ein Element Dictionary<TKey,TValue> erstellt werden soll.

keySelector
Func<TSource,TKey>

Eine Funktion zum Extrahieren eines Schlüssels aus jedem Element.

elementSelector
Func<TSource,TElement>

Eine Transformationsfunktion, um einen Ergebniselementwert aus jedem Element zu erzeugen.

comparer
IEqualityComparer<TKey>

Eine IEqualityComparer<T> zum Vergleichen von Schlüsseln.

cancellationToken
CancellationToken

Der CancellationToken zu überwachende Monitor für Abbruchanforderungen. Der Standardwert lautet None.

Gibt zurück

ValueTask<Dictionary<TKey,TElement>>

Ein Dictionary<TKey,TValue> Wert, der Werte vom Typ TElement enthält, die aus der Eingabesequenz ausgewählt sind.

Ausnahmen

elementSelector ist null.

source enthält mindestens einen doppelten Schlüssel (über die zurückgegebene Aufgabe).

Gilt für:

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

Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs

Erstellt eine Dictionary<TKey,TValue> aus einer IAsyncEnumerable<T> gemäß einer angegebenen Schlüsselauswahlfunktion.

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

Typparameter

TSource

Der Typ der Quellelemente.

TKey

Der Typ der von keySelector.

Parameter

source
IAsyncEnumerable<TSource>

Ein IAsyncEnumerable<T> , aus dem ein Element Dictionary<TKey,TValue> erstellt werden soll.

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

Eine Funktion zum Extrahieren eines Schlüssels aus jedem Element.

comparer
IEqualityComparer<TKey>

Eine IEqualityComparer<T> zum Vergleichen von Schlüsseln.

cancellationToken
CancellationToken

Der CancellationToken zu überwachende Monitor für Abbruchanforderungen. Der Standardwert lautet None.

Gibt zurück

ValueTask<Dictionary<TKey,TSource>>

A Dictionary<TKey,TValue> , das Schlüssel und Werte enthält.

Ausnahmen

keySelector ist null.

source enthält mindestens einen doppelten Schlüssel (über die zurückgegebene Aufgabe).

Gilt für:

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

Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs
Quelle:
ToDictionaryAsync.cs

Erstellt eine Dictionary<TKey,TValue> aus einer IAsyncEnumerable<T> gemäß einer angegebenen Schlüsselauswahlfunktion.

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

Typparameter

TSource

Der Typ der Quellelemente.

TKey

Der Typ der von keySelector.

Parameter

source
IAsyncEnumerable<TSource>

Ein IAsyncEnumerable<T> , aus dem ein Element Dictionary<TKey,TValue> erstellt werden soll.

keySelector
Func<TSource,TKey>

Eine Funktion zum Extrahieren eines Schlüssels aus jedem Element.

comparer
IEqualityComparer<TKey>

Eine IEqualityComparer<T> zum Vergleichen von Schlüsseln.

cancellationToken
CancellationToken

Der CancellationToken zu überwachende Monitor für Abbruchanforderungen. Der Standardwert lautet None.

Gibt zurück

ValueTask<Dictionary<TKey,TSource>>

A Dictionary<TKey,TValue> , das Schlüssel und Werte enthält.

Ausnahmen

keySelector ist null.

source enthält mindestens einen doppelten Schlüssel (über die zurückgegebene Aufgabe).

Gilt für: