AsyncEnumerable.ToDictionary<TSource, TKey, TElement> Method (IAsyncEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, IEqualityComparer<TKey>, CancellationToken) |
Namespace: System.LinqAssembly: System.Interactive.Async (in System.Interactive.Async.dll) Version: 1.2.0.0
Syntaxpublic static Task<Dictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(
this IAsyncEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector,
IEqualityComparer<TKey> comparer,
CancellationToken cancellationToken
)
Parameters
- source
- Type: System.Collections.Generic.IAsyncEnumerable<TSource>
- keySelector
- Type: System.Func<TSource, TKey>
- elementSelector
- Type: System.Func<TSource, TElement>
- comparer
- Type: System.Collections.Generic.IEqualityComparer<TKey>
- cancellationToken
- Type: System.Threading.CancellationToken
Type Parameters
- TSource
- TKey
- TElement
Return Value
Type:
Task<Dictionary<TKey,
TElement>>Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IAsyncEnumerable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also