QueryableExtensionMethods.ToDictionaryAsync<TSource, TKey> Method (IQueryable<TSource>, Func<TSource, TKey>) |
Creates a Dictionary from the source by executing the source asynchronously, then enumerating it according to a specified key selector function.
Namespace:
SD.LLBLGen.Pro.LinqSupportClasses
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.12.0.0 (5.12.0)
Syntaxpublic static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(
this IQueryable<TSource> source,
Func<TSource, TKey> keySelector
)
<ExtensionAttribute>
Public Shared Function ToDictionaryAsync(Of TSource, TKey) (
source As IQueryable(Of TSource),
keySelector As Func(Of TSource, TKey)
) As Task(Of Dictionary(Of TKey, TSource))
Parameters
- source
- Type: System.Linq.IQueryable<TSource>
the source - keySelector
- Type: System.Func<TSource, TKey>
the key selector function
Type Parameters
- TSource
- the type of the elements in source
- TKey
- the type of the key
Return Value
Type:
Task<Dictionary<TKey,
TSource>>the results of source in a new dictionary with the results of the keyselector as keys
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IQueryable<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).
RemarksNot usable wrapped inside a Linq query. Use this method to execute a linq query asynchronously
See Also