逆向迁移 Db First(数据库——实体)
一,更新DbContext
Scaffold-DbContext '连接字符串' Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -force
二,与数据库字段大小写同步(-usedatabasename)
Scaffold-DbContext '连接字符串' Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -force -usedatabasename
三,初始化DBContext
Scaffold-DbContext "连接字符串" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
Code First(实体——数据库)
dotnet ef migrations
dotnet ef database
dotnet ef dbcontext