All docs
V20.1
20.2 (EAP/Beta)
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+

Session.UpdateSchemaAsync(CancellationToken) Method

Asynchronously updates the storage schema according to the class descriptions that are listed in the assemblies that have been loaded into the application domain.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v20.1.dll

Declaration

public Task UpdateSchemaAsync(
    CancellationToken cancellationToken = default(CancellationToken)
)
Public Function UpdateSchemaAsync(
    cancellationToken As CancellationToken = Nothing
) As Task

Optional Parameters

Name Type Default Description
cancellationToken CancellationToken

null

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

Returns

Type Description
Task

A Task that updates the storage schema according to the class descriptions that are listed in the assemblies that have been loaded into the application domain.

Remarks

using System.Threading;
using System.Threading.Tasks;
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
using DevExpress.Xpo.Metadata;
// ...
public async Task CreateDatabase(string connectionString, params XPClassInfo[] persistentClasses) {
    using(IDataLayer dal = XpoDefault.GetDataLayer(connectionString, AutoCreateOption.DatabaseAndSchema)) {
        UnitOfWork uow = new UnitOfWork(dal);
        await uow.UpdateSchemaAsync(CancellationToken.None, persistentClasses);
        await uow.CreateObjectTypeRecordsAsync(CancellationToken.None, persistentClasses);
    }
}
See Also