DbRawSqlQuery<TElement>.ToDictionaryAsync Method
Creates a dictionary from the query by enumerating it asynchronously according to a specified key selector function.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | ToDictionaryAsync<TKey>(Func<TElement, TKey>) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function. |
![]() | ToDictionaryAsync<TKey>(Func<TElement, TKey>, CancellationToken) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function. |
![]() | ToDictionaryAsync<TKey>(Func<TElement, TKey>, IEqualityComparer<TKey>) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function and a comparer. |
![]() | ToDictionaryAsync<TKey>(Func<TElement, TKey>, IEqualityComparer<TKey>, CancellationToken) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function and a comparer. |
![]() | ToDictionaryAsync<TKey, TResult>(Func<TElement, TKey>, Func<TElement, TResult>) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector and an element selector function. |
![]() | ToDictionaryAsync<TKey, TResult>(Func<TElement, TKey>, Func<TElement, TResult>, CancellationToken) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector and an element selector function. |
![]() | ToDictionaryAsync<TKey, TResult>(Func<TElement, TKey>, Func<TElement, TResult>, IEqualityComparer<TKey>) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function. |
![]() | ToDictionaryAsync<TKey, TResult>(Func<TElement, TKey>, Func<TElement, TResult>, IEqualityComparer<TKey>, CancellationToken) | Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function. |
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey> Method (Func<TElement, TKey>)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TKey>( Func<TElement, TKey> keySelector )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TElement>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.
Type Parameters
- TKey
The type of the key returned by keySelector .
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey> Method (Func<TElement, TKey>, CancellationToken)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TKey>( Func<TElement, TKey> keySelector, CancellationToken cancellationToken )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TElement>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.
Type Parameters
- TKey
The type of the key returned by keySelector .
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey> Method (Func<TElement, TKey>, IEqualityComparer<TKey>)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function and a comparer.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TKey>( Func<TElement, TKey> keySelector, IEqualityComparer<TKey> comparer )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
- comparer
-
Type:
System.Collections.Generic.IEqualityComparer<TKey>
An IEqualityComparer<T> to compare keys.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TElement>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.
Type Parameters
- TKey
The type of the key returned by keySelector .
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey> Method (Func<TElement, TKey>, IEqualityComparer<TKey>, CancellationToken)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function and a comparer.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TKey>( Func<TElement, TKey> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
- comparer
-
Type:
System.Collections.Generic.IEqualityComparer<TKey>
An IEqualityComparer<T> to compare keys.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TElement>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.
Type Parameters
- TKey
The type of the key returned by keySelector .
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey, TResult> Method (Func<TElement, TKey>, Func<TElement, TResult>)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector and an element selector function.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TResult>> ToDictionaryAsync<TKey, TResult>( Func<TElement, TKey> keySelector, Func<TElement, TResult> elementSelector )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
- elementSelector
-
Type:
System.Func<TElement, TResult>
A transform function to produce a result element value from each element.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TResult>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TResult selected from the query.
Type Parameters
- TKey
The type of the key returned by keySelector .
- TResult
The type of the value returned by elementSelector.
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey, TResult> Method (Func<TElement, TKey>, Func<TElement, TResult>, CancellationToken)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector and an element selector function.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TResult>> ToDictionaryAsync<TKey, TResult>( Func<TElement, TKey> keySelector, Func<TElement, TResult> elementSelector, CancellationToken cancellationToken )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
- elementSelector
-
Type:
System.Func<TElement, TResult>
A transform function to produce a result element value from each element.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TResult>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TResult selected from the query.
Type Parameters
- TKey
The type of the key returned by keySelector .
- TResult
The type of the value returned by elementSelector.
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey, TResult> Method (Func<TElement, TKey>, Func<TElement, TResult>, IEqualityComparer<TKey>)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TResult>> ToDictionaryAsync<TKey, TResult>( Func<TElement, TKey> keySelector, Func<TElement, TResult> elementSelector, IEqualityComparer<TKey> comparer )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
- elementSelector
-
Type:
System.Func<TElement, TResult>
A transform function to produce a result element value from each element.
- comparer
-
Type:
System.Collections.Generic.IEqualityComparer<TKey>
An IEqualityComparer<T> to compare keys.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TResult>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TResult selected from the input sequence.
Type Parameters
- TKey
The type of the key returned by keySelector .
- TResult
The type of the value returned by elementSelector.
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
DbRawSqlQuery<TElement>.ToDictionaryAsync<TKey, TResult> Method (Func<TElement, TKey>, Func<TElement, TResult>, IEqualityComparer<TKey>, CancellationToken)
Creates a Dictionary<TKey, TValue> from the query by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public Task<Dictionary<TKey, TResult>> ToDictionaryAsync<TKey, TResult>( Func<TElement, TKey> keySelector, Func<TElement, TResult> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken )
Parameters
- keySelector
-
Type:
System.Func<TElement, TKey>
A function to extract a key from each element.
- elementSelector
-
Type:
System.Func<TElement, TResult>
A transform function to produce a result element value from each element.
- comparer
-
Type:
System.Collections.Generic.IEqualityComparer<TKey>
An IEqualityComparer<T> to compare keys.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Return Value
Type: System.Threading.Tasks.Task<Dictionary<TKey, TResult>>A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TResult selected from the input sequence.
Type Parameters
- TKey
The type of the key returned by keySelector .
- TResult
The type of the value returned by elementSelector.
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.