Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

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

Asynchronously enumerates a query and uses a key selector to construct a Lookup<TKey,TElement>.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public static Task<ILookup<TKey, T>> ToLookupAsync<T, TKey>(
    this IQueryable<T> query,
    Func<T, TKey> keySelector,
    CancellationToken cancellationToken = default(CancellationToken)
)

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.

Optional Parameters

Name Type Default Description
cancellationToken CancellationToken *null*

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

Type Parameters

Name
T
TKey

Returns

Type Description
Task<ILookup<TKey, T>>

A Task that returns a Lookup<TKey,TElement>.

See Also