All docs
V21.2
21.2
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

XPBaseCollection.LoadAsync(CancellationToken) Method

Asynchronously loads persistent objects of a specific type from the data store into the collection.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v21.2.dll

Declaration

public virtual Task LoadAsync(
    CancellationToken cancellationToken
)

Parameters

Name Type Description
cancellationToken CancellationToken

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

Returns

Type Description
Task

A Task that starts the collection load.

Remarks

Note

If the XPBaseCollection.LoadingEnabled property is set to false, calling the LoadAsync method has no effect.

The following example demonstrates how to asynchronously work with persistent objects.

using DevExpress.Xpo;
// ...
XPCollection<Customer> customers = new XPCollection<Customer>(session);
await customers.LoadAsync();
gridControl.DataSource = customers;
See Also