Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Entity Framework Powertools 生成我的模型——它可以很好地使模型保持最新状态。但是,我怎样才能使实际的数据库方案保持最新?如何填充测试数据?我觉得这应该已经在某个地方覆盖了,但谷歌让我失望了。
考虑到您使用的是“数据库优先”方法,您可以(在 Visual Studio 中)从您的方案中创建一个“数据库项目” 。
使用数据库项目,您无需打开 Sql Managemenet Studio 来维护方案,您可以配置部署,包括使用部署前和部署后脚本加载的数据。我相信这是解决您问题的一种简单、优雅和专业的方法。
数据库项目在 Visual Studio 2012 中得到了改进。
希望能帮助到你。