XPQueryExtensions.ToDictionaryAsync<T, TKey, TElement>(IQueryable<T>, Func<T, TKey>, Func<T, TElement>, CancellationToken) Method
Asynchronously enumerates a query and uses a key selector and an element selector to construct a Dictionary<TKey,TValue>.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.1.dll
NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap, DevExpress.Xpo
NuGet Package: DevExpress.Xpo
Declaration
Parameters
Name | Type | Description |
---|---|---|
query | IQueryable<T> | An XPQuery<T> to be enumerated. |
keySelector | Func<T, TKey> | An function that acquires each persistent object’s key. |
elementSelector | Func<T, TElement> | A function that returns a result value for each persistent object. |
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 |
TElement |
Returns
Type | Description |
---|---|
Task<Dictionary<TKey, TElement>> | A Task that returns a Dictionary<TKey,TValue>. |
See Also