生成MS SQLServer EF
PM> Install-Package Microsoft.EntityFrameworkCore.SqlServer
PM> Install-Package Microsoft.EntityFrameworkCore.Tools
PM> Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design
Scaffold-DbContext "Server=.;Database=st_DB;Integrated Security=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models (-force(重写加这个))
生成MySql EF
PM> Install-Package MySql.Data.EntityFrameworkCore -Pre
PM> Install-Package Pomelo.EntityFrameworkCore.MySql
PM> Install-Package Microsoft.EntityFrameworkCore.Tools
PM> Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design
PM> Scaffold-DbContext "server=localhost;userid=root;pwd=;port=3306;database=st_film;sslmode=none;" Pomelo.EntityFrameworkCore.MySql -OutputDir EF -Force
网友评论