XPQueryExtensions.EnumerateAsync<T>(IQueryable<T>, XPQueryExtensions.AsyncEnumerateCallback<T>) Method
Asynchronously enumerates a specified query and notifies upon completion.
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. |
callback | DevExpress.Xpo.XPQueryExtensions.AsyncEnumerateCallback<T> | An AsyncEnumerateCallback<T> delegate, which is a method to be called after all elements in the query are enumerated. |
Type Parameters
Name |
---|
T |
Remarks
Example:
using System.Linq;
using DevExpress.Xpo;
using System.Collections.Generic;
// ...
var data = from c in session1.Query<Person>()
where c.LastName.StartsWith("A")
select c;
// Asynchronously loads XPQuery and enumerates it
data.EnumerateAsync<Contact>(delegate(IEnumerable<Contact> objects, Exception ex)
{
// Process loaded objects here
});
See Also