其他分享
首页 > 其他分享> > dotnetcore EF migration

dotnetcore EF migration

作者:互联网

migration命令需要安装Microsoft.EntityFrameworkCore.Tools

dotnet add package Microsoft.EntityFrameworkCore.sqlserver --version 5.0.13
dotnet add package Microsoft.EntityFrameworkCore.Tools --version 5.0.13

migration命令

add-migration init
update-database stateX -- update db to stateX
remove-migration

生成sql script

script-migration

逆向生成C#代码

scaffold-dbcontext // generate entity class from db

标签:script,EF,v1,add,dotnetcore,generate,EntityFrameworkCore,migration
来源: https://www.cnblogs.com/mryux/p/15854318.html