The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

XPQueryExtensions.ToDictionaryAsync<T, TKey>(IQueryable<T>, Func<T, TKey>, CancellationToken) Method

Asynchronously enumerates a query and uses a key selector to construct a Dictionary<TKey,TValue>.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public static Task<Dictionary<TKey, T>> ToDictionaryAsync<T, TKey>(
    this IQueryable<T> query,
    Func<T, TKey> keySelector,
    CancellationToken cancellationToken = default(CancellationToken)
)
<ExtensionAttribute>
Public Shared Function ToDictionaryAsync(Of T, TKey)(
    query As IQueryable(Of T),
    keySelector As Func(Of T, TKey),
    cancellationToken As CancellationToken = Nothing
) As Task(Of Dictionary(Of TKey, T))
public static Task<Dictionary<TKey, T>> ToDictionaryAsync<T, TKey>(
    this IQueryable<T> query,
    Func<T, TKey> keySelector,
    CancellationToken cancellationToken = default(CancellationToken)
)
<ExtensionAttribute>
Public Shared Function ToDictionaryAsync(Of T, TKey)(
    query As IQueryable(Of T),
    keySelector As Func(Of T, TKey),
    cancellationToken As CancellationToken = Nothing
) As Task(Of Dictionary(Of TKey, T))

Parameters

Name Type Description
query IQueryable<T>

An XPQuery<T> to be enumerated.

keySelector Func<T, TKey>

A function that acquires each persistent object's key.

cancellationToken CancellationToken

A CancellationToken object that delivers a cancellation notice to the running operation.

Parameters

Name Type Description
query IQueryable<T>

An XPQuery<T> to be enumerated.

keySelector Func<T, TKey>

A function that acquires each persistent object's key.

cancellationToken CancellationToken

A CancellationToken object that delivers a cancellation notice to the running operation.

Returns

Type Description
Task<Dictionary<TKey, T>>

A Task that returns a Dictionary<TKey,TValue>.

Returns

Type Description
Task<Dictionary<TKey, T>>

A Task that returns a Dictionary<TKey,TValue>.

Type Parameters

Name Description
T
TKey

Type Parameters

Name Description
T
TKey
See Also