In-Depth XAF WinForms & ASP.NET Tutorial (Main Demo)
- 4 minutes to read
Follow this tutorial to create a simple application used to store contacts and other related objects as you learn about the fundamentals of the eXpressApp Framework.
Dependencies and Prerequisites
Before you start the tutorial, read this section and ensure that the following conditions are met:
- Any non-Express supported version of Visual Studio is installed on your machine. You have basic experience of .NET framework development in this IDE.
- A free 30-day trial version or a licensed version of DevExpress Universal Subscription is installed on your machine.
- You have basic knowledge of Object-relational mapping (ORM) concepts and the Microsoft ADO.NET Entity Framework or DevExpress XPO.
- Any RDBMS supported by the XPO (see Database Systems Supported by XPO) or Entity Framework 6 (see Entity Framework 6 Providers) ORM tools is installed and accessible from your machine to store the application data (a LocalDB or SQL Server Express instance is recommended).
- You are familiar with XAF application architecture.
The tutorial consists of the following sections.
This section is split into two parts, which describe the use of two different Object-relational mapping (ORM) tools: Entity Framework 6 (EF 6) and eXpress Persistent Objects (XPO). You will start by choosing the one ORM you will use in your project and the subsequent steps will reflect your choice. In this section, you will implement classes that will form the business model (which defines the database tables) of your application. As a result of completing this section, you will end up with two automatically generated interfaces based on the same business model - a WinForms application and a website. In addition, these applications will contain a set of features that form the base application functionality.
In this section, you will add custom features to the application built in the previous section.
This section will teach you how to easily customize the automatically generated UI of an application.
In this section, you will add extra features supplied with XAF (file attachment, data analysis, report generation, etc.).
Use this section to learn how to make the application secure by adding the XAF Security System to it.
Each section consists of a number of lessons. Each lesson provides the steps required for implementing the functionality mentioned in the lesson title. These steps include the exact instructions , and may also include code snippets (in C# and VB) and images.
The final application created as a result of this tutorial is included in the XAF installation. The Entity Framework version of the Main Demo is located in the %PUBLIC%\Documents\DevExpress Demos 21.1\Components.NET Core Desktop Libraries\eXpressApp Framework\EFDemoCodeFirst folder, and eXpress Persistent Objects version is located in the %PUBLIC%\Documents\DevExpress Demos 21.1\Components.NET Core Desktop Libraries\eXpressApp Framework\MainDemo folder by default. This application is intended to demonstrate a wide variety of features for implementing tasks in XAF applications..
Begin by ensuring that you have a Microsoft SQL Server database management system (DBMS) installed. If you use a different DBMS, you will need to provide the proper connection strings.
Use the Solution Wizard to create a solution. 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 LocalDB editions). To use another database system (PostgreSQL, MySQL, Oracle, SQLite, Firebird, etc.), change the ConnectionString argument in the App.config and Web.config files of the WinForms/ASP.NET application projects. Refer to the Connect an XAF Application to a Database Provider topic for details about connecting to different database systems. A database will be created on the server under the name of the solution you created. If you wish to change any of these details, you will need to make the necessary changes to the connection string by using the application configuration file (App.config or Web.config) or using the Application Designer. Refer to the Connect an XAF Application to a Database Provider topic for additional information on connection strings.
If you ever need to recreate your database, just drop it from the database server or remove the file, and it will be recreated automatically the next time the application runs.