Solution Wizard
- 5 minutes to read
XAF features the Solution Wizard, which allows you to create a new application in a few steps. The wizard allows you to:
- Choose the target platform
- Choose data model type (Entity Framework Core, or eXpressPersistent Objects (XPO))
- Set Security System settings
- Select Additional Modules to include in your application.
The wizard generates a solution according to the specified settings.
The Solution Wizard is available when you add a new project.
In the Add a new project dialog, find the DevExpress v24.1 XAF Template Gallery and click Next.
- Configure your new project and click Create to invoke the Template Gallery.
In the Template Gallery, select the following options:
- .NET framework
- C# programming language
- XAF Solution Wizard (.NET)
Click Run Wizard.
Tip
You can also run the Solution Wizard from the DevExpress Template Gallery. To find the wizard, choose XAF in the Platform combo box.
#Step 1 – Choose the Target Platforms
In this step, you can select:
- For the .NET Framework solution: Desktop (Windows Forms), Web (ASP.NET Web Forms), or multiple applications at once.
- For the .NET solution: Desktop (Windows Forms), Web (ASP.NET Core Blazor), Service (ASP.NET Core Web API), or multiple applications at once.
The wizard will add the required platform-specific application and module projects.
#Step 2 – Choose the ORM
In this step, you can choose your data model type: Entity Framework Core or eXpress Persistent Objects (XPO).
The wizard will add code that registers an appropriate Object Space Provider (see XafApplication.ObjectSpaceProvider). If you choose Entity Framework Code First or Entity Framework Core, the wizard will generate the DbContext class code.
#Step 3 – Enable End-to-End Tests and Multitenancy
In this step, you can add the following functionality: Functional Tests and Multitenancy.
#Step 3 – Enable the Security System and Choose the Authentication Type
In this step, you can enable the Security System and select the authentication type.
If you selected Windows and XPO in the previous steps, you can also choose the client-side security mode or set up the middle-tier security.
The wizard will add code that configures the Security System and populates the data model with the entities required to persist Security System data (users, roles and permissions). If you choose Standard authentication, it will also add code that creates the “Admin” user with an empty password to the Updater.cs (Updater.vb) file. If you choose Active Directory authentication, a similar code will be added, but the user name will be taken from your current Windows account.
With the Security System enabled, the wizard also adds the code demonstrated in the How to: Store the Application Model Differences in the Database topic. This code configures the Database Model Difference Storage in both WinForms and ASP.NET Web Forms modules.
#Step 4 – Choose Additional Modules
In this last step, you can choose the XAF additional modules to include.
The wizard will register the selected modules and add the entities required by these modules to the data model.
#Result
The following image demonstrates the generated solution.
Note
The wizard attempts to detect your installed SQL server and changes the connection string accordingly. Supported servers are Microsoft SQL Server (including the Express and Local
#Add a Project to an Existing XAF Solution
You can also run the Solution Wizard for an existing solution to create additional XAF projects. Right-click the solution in the Solution Explorer, choose Add | New Project… and select DevExpress v24.1 XAF Template Gallery and click Next. In the Template Gallery, select the newly added project settings and click Run Wizard. The image below shows the Wizard’s start page in this case.
The table below lists the available projects and their descriptions.
Template Name | Description | See Also |
---|---|---|
Win | Generate an XAF-powered Windows Forms projects for desktop application development (. | |
ASP. | Generate an XAF-powered ASP. | |
ASP. | Generate an XAF-powered ASP. | |
Reusable Module Library | Create a Class Library project to reuse data model, business logic, UI elements, and settings within XAF-powered apps and modules (. | |
Middle Tier App Server | Create a Middle Tier App Server project to secure database access for XAF-powered Windows Forms client apps using the XPO ORM (. | |
Workflow App Server | Create a Workflow App Server project to start long-running processes as workflows within XAF-powered apps using the Windows Workflow Foundation (. | |
ASP. | Generate an ASP. |