Define the Data Model and Set the Initial Data(定义数据模型并设置初始数据)
This section explains how to design a business model (database) for an application built with Cross-Platform .NET App UI (XAF) and Entity Framework Core.
本节介绍如何为使用跨平台构建的应用程序设计业务模型(数据库)。NET应用程序UI(XAF)和实体框架核心。
You will learn how to complete the following tasks:
您将学习如何完成以下任务:
- Create business classes mapped to database tables(创建映射到数据库表的业务类)
- Define relationships between classes(定义类之间的关系)
- Implement dependent properties(实现依赖属性)
To design a business model, build custom classes and inherit your business objects from the BaseObject class.
要设计业务模型,请构建自定义类并从BaseObject类继承您的业务对象。
Tip
You can use the PMC or CLI tool to generate the business model from an existing database instead of creating it from scratch in Entity Framework Core. To learn more about this approach in EF Core, refer to the following article: Reverse Engineering.
您可以使用PMC或CLI工具从现有数据库生成业务模型,而不是在Entity Framework Core中从头开始创建。要在EF Core中了解有关此方法的更多信息,请参阅以下文章:逆向工程。
Once you complete the tutorial, your application will look as shown in the image below:
完成本教程后,您的应用程序将如下图所示:
ASP.NET Core Blazor
Windows Forms
Proceed to Create a Solution to start the tutorial.
继续创建解决方案以开始本教程。