【发布时间】:2012-04-28 02:57:57
【问题描述】:
首先使用代码时,EF 迁移实用程序似乎相当不错。
基于this blog post,我尝试在我们使用模型优先的项目中设置它。运行Enable-Migrations 命令时,出现以下错误:
不支持创建 DbModelBuilder 或从使用 Database First 或 Model First 创建的 DbContext 编写 EDMX。 EDMX 只能从不使用现有 DbCompiledModel 创建的 Code First DbContext 中获取。
有什么办法可以让我们在不切换到代码优先的情况下使用 EF 迁移?
【问题讨论】:
-
我猜不是 - 这是例外情况所说的,但对Data UserVoice 来说是个不错的建议。
标签: .net entity-framework-4 database-migration ef-model-first