model first,DB first,code first

code first迁移数据库
1.打开程序包管理器控制台
2.运行Enable-Migrations,运行之后会生成Migrations文件夹与相应的文件 Configuration.cs
3.设置 AutomaticMigrationsEnabled为 true
4.最后执行 Update-Database
5.ok。
model first
1.建立空模型
2.根据模型生成数据库
3.鼠标右键,执行sql语句。

db first
根据数据库生成模型

原文地址:https://www.cnblogs.com/zt666/p/6213958.html