Skip to main content
.NET Framework 4.5.2+

XPQueryExtensions.EnumerateAsync<T>(IQueryable<T>, XPQueryExtensions.AsyncEnumerateCallback) Method

Asynchronously enumerates a specified query and notifies upon completion.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public static void EnumerateAsync<T>(
    this IQueryable<T> query,
    XPQueryExtensions.AsyncEnumerateCallback callback
)

Parameters

Name Type Description
query IQueryable<T>

An XPQuery<T> to be enumerated.

callback DevExpress.Xpo.XPQueryExtensions.AsyncEnumerateCallback

An AsyncEnumerateCallback 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;

// ...

var data = from c in session1.Query<Person>()
           where c.LastName.StartsWith("A")
           select c;

// Asynchronously loads XPQuery and enumerates it
data.EnumerateAsync(delegate(IEnumerable objects, Exception ex)
{
    // Process loaded objects here
});
See Also