【发布时间】:2013-03-25 04:20:04
【问题描述】:
我最近开始使用MVC 4 开发分区解决方案,我使用Structuring Solutions and Projects 和Adding an existing Visual Studio solution to another solution 设置我的解决方案。我的系统已全部设置好,可以构建,并且我已在两种解决方案上启用了迁移。每个解决方案有 4 个项目(域、数据、单元测试和 WebUI),子解决方案有来自主解决方案的引用。数据层包含所有存储库和 DbContext 类。每个解决方案都有自己的连接字符串,因此我打算为添加到系统中的每个解决方案创建单独的数据库。
我试图使用Update Database -Verbose 更新Package Manager Console 中的数据库,这适用于主解决方案,但不适用于子解决方案。迁移文件位于数据层。
注意:我运行Update-Database -Verbose
Using StartUp project Master.WebUI and
Using NuGet project Master.Data(主解决方案)
Using StartUp project Child.WebUI and
Using NuGet project Child.Data(子解决方案)
我应该怎么做才能完成这项工作?
【问题讨论】:
-
我并没有完全解决这个问题,但我所做的是重新创建
Child solution并制作第一个Updat-Database,然后将其添加到Master Solution
标签: c# asp.net-mvc-4 visual-studio-2012 ef-code-first entity-framework-migrations