多工程解决方案中迁移数据库
使用 -project 添加项目名称:
1.创建迁移
add-migration newmigration -project databaseservice -context productcontext
2.更新数据库
update-database -project databaseservice -context productcontext
注意:在修改实体类后需重新编译一次,再进行迁移。
使用 -project 添加项目名称:
1.创建迁移
add-migration newmigration -project databaseservice -context productcontext
2.更新数据库
update-database -project databaseservice -context productcontext
注意:在修改实体类后需重新编译一次,再进行迁移。