当前位置: 首页 > 工具软件 > ASP.NET Core > 使用案例 >

ASP.NET Core 5.0

干鑫鹏
2023-12-01

ASP.NET Core 5.0
1、新建项目
Ctrl+Shift+N
ASP.NET Core Web
WebApi
F5
2、所需NUGET包
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools

Microsoft.EntityFrameworkCore
Pomelo.EntityFrameworkCore.MySql (5.0.0-alpha.2)
Microsoft.Bcl.AsyncInterfaces

错误
Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework Core tools are running. Use ‘EntityFramework6\Add-Migration’ for Entity Framework 6.

var connectionString = Configuration.GetConnectionString("MySql");
services.AddDbContext<MyDbContext>(options => options.UseMySql(connectionString, MySqlServerVersion.LatestSupportedServerVersion));

EntityFrameworkCore\Add-Migration init
EntityFrameworkCore\Update-Database -verbose

 类似资料:

相关阅读

相关文章

相关问答