XafApplication.CheckCompatibilityType Property
Specifies how the database and application compatibility is checked.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Property Value
Type | Default | Description |
---|---|---|
CheckCompatibilityType | ModuleInfo | A CheckCompatibilityType enumeration value that specifies how database and application compatibility is checked. |
Remarks
You can set CheckCompatibilityType
to the following values.
Value | Description |
---|---|
| XAF performs the following checks:
The XafApplication.DatabaseVersionMismatch event occurs if any of these checks fails. If the database does not exist, XAF creates the database and required tables. If the database exists, but it is empty, XAF creates the tables. If a column does not exist, XAF adds it to the table (only in applications that use XPO ORM). In applications that use XPO ORM, XAF utilizes native XPO techniques to check the conditions. In applications that use Entity Framework Core ORM, XAF uses the EnsureCreated() method. |
| In this mode, XAF creates a If your application uses Entity Framework Core ORM, register the Each module’s default version value is “1.0.*“ (specified by the AssemblyVersion attribute in the Properties\AssemblyInfo.cs file). The asterisk in the version number indicates that build and revision numbers are incremented automatically. XAF updates the version number with each new build. As a result, module versions may become unsynchronized if you build Windows Forms and ASP.NET Web Forms or ASP.NET Core Blazor applications separately (for example, when you create a ClickOnce installation or deploy to IIS). This mode is more complicated compared to |
You can change the CheckCompatibilityType
property value in the Application Designer:
XafApplication sets CheckCompatibilityType
to its default value of ModuleInfo
. However, an XafApplication
descendant overrides the default value to DatabaseSchema
in code generated by the Solution Wizard. This change preserves the behavior of applications created in earlier versions. The following example shows how this code may look:
// ...
public class MainDemoBlazorApplication : BlazorApplication {
public MainDemoBlazorApplication() {
// ...
CheckCompatibilityType = DevExpress.ExpressApp.CheckCompatibilityType.DatabaseSchema;
// ...
}
}
Tip
Use the IObjectSpaceProvider.CheckCompatibilityType property to specify the mode individually for each Object Space Provider (in case you use multiple databases).
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CheckCompatibilityType property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.