code first 常用命令

作者: 吴杰 分类: 编程 发布时间: 2014-09-04 10:41

code first 常用命令

 Enable-Migrations  -EnableAutomaticMigrations -Force   //code first启用迁移,并允许自动迁移

 Enable-Migrations  第一次开启迁移时执行

添加迁移

add-Migration xxx   
update-database //更新数据库

MSDN说明见这里: http://msdn.microsoft.com/en-us/library/dn579398.aspx