BigBox777

爱学习、爱运动

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

1、在vs中的“程序包管理器控制台”中输入命令,先初始化迁移数据上下文和迁移目录  Core使用:EntityFrameworkCore\Enable-Migrations    EF使用:EntityFramework6\Enable-Migrations

 

2、增加迁移  Core使用:EntityFrameworkCore\Add-Migration InitSpiderDB    EF使用:EntityFramework6\Add-Migration InitSpiderDB

 

3、更新到数据库  Core使用:EntityFrameworkCore\update-database    EF使用:EntityFramework6\update-database

 

4、如果想删除迁移  Core使用:EntityFrameworkCore\Remove-Migration    EF使用:EntityFramework6\Remove-Migration

 

5、查看迁移帮助     Core使用:get-help entityframeworkcore    EF使用:get-help EntityFramework6

 

posted on 2021-01-03 15:15  BigBox777  阅读(588)  评论(0编辑  收藏  举报