点击“了解更多”获取DevExpress v20.2完整版下载
经过DevExpress WPF Controls,您能创立有着强壮互动功用的XAML根底应用程序,这些应用程序专心于今世客户的需求和构建未来新一代支撑接触的解决方案。
在本文中,空白示例项目(.NET Core 3.1)是连接到Northwind数据库。
数据库结构:
您可以运用此示例创立DevExpress项目并体会相关功用,该项目引进DevExpress ThemedWindow作为根元素。
要创立一个项目并将其连接到数据库:
1. 创立一个新项目:
2. 挑选DevExpress v20.1 WPFBlank App (.NET Core):
3. 指定项目名称,然后单击创立:
4. 将Microsoft.EntityFrameworkCore.SqlServer和Microsoft.EntityFrameworkCore.Tools NuGet程序包添加到项目中:
5. 翻开Package Manager Console然后运转以下指令,此指令为DbContext和数据库的实体类型生成代码:
Scaffold-DbContext "Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Data\Northwind.mdf;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context NorthwindEntities -Tables "Categories","Customers","CustomerDemographics","Employees","Orders","Order Details","Products","Region","Shippers","Suppliers","Territories"
有关怎么运用Scaffold-DbContext指令的更多信息,请参阅docs.microsoft/en-us/ef/core/miscellaneous/cli/powershell#scaffold-dbcontext 。