EF CodeFirst 通过代码生成数据库

1. 启用迁移: Enable-Migrations

 

2. 添加迁移: Add-Migration

  

3. 将迁移更新到数据库:Update-Database

 

这样,就完成了更新数据库