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.EnumerateAsync<T>(IQueryable<T>, XPQueryExtensions.AsyncEnumerateCallback<T>) Method

Asynchronously enumerates a specified query and notifies upon completion.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public static void EnumerateAsync<T>(
    this IQueryable<T> query,
    XPQueryExtensions.AsyncEnumerateCallback<T> callback
)
<ExtensionAttribute>
Public Shared Sub EnumerateAsync(Of T)(
    query As IQueryable(Of T),
    callback As XPQueryExtensions.AsyncEnumerateCallback(Of T)
)
public static void EnumerateAsync<T>(
    this IQueryable<T> query,
    XPQueryExtensions.AsyncEnumerateCallback<T> callback
)
<ExtensionAttribute>
Public Shared Sub EnumerateAsync(Of T)(
    query As IQueryable(Of T),
    callback As XPQueryExtensions.AsyncEnumerateCallback(Of T)
)

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.

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 Description
T

Type Parameters

Name Description
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