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