EntityFramework 7 (EF7) 迁移.DbContext 和 StartUp Project 在不同的程序集中 [英] EntityFramework 7 (EF7) Migrations. DbContext and StartUp Project are in different assemblies

查看:34
本文介绍了EntityFramework 7 (EF7) 迁移.DbContext 和 StartUp Project 在不同的程序集中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 EF7 中的迁移与 entityframework.commands 结合使用.但是我的 DbContext 与 Start-up 项目在不同的程序集中(asp.net mvc 是一个启动项目,Core.Implementation 有一个 DbContex).

I'm trying to use migrations in EF7 with entityframework.commands. But my DbContext is in different assembly with Start-up project (asp.net mvc is an start-up project and Core.Implementation has a DbContex).

dnx .ef迁移添加MyMigration -c MyContext

System.InvalidOperationException:未找到名为MyContext"的 DbContext.

我尝试使用命名空间指向其他程序集,但它也不起作用.有可能吗?或者我只需要将我的上下文放在 ef7 命令所在的程序集中?

I've tried to use namespace to point to other assembly but it didn't work either. Is it possible at all? Or I just have to put my context in assembly where ef7 command is?

推荐答案

每个问题 #639#2256#2293, #2294#2357#2553 &#2748,我们在这方面还有一些工作要做.:-)

Per issues #639, #2256, #2293, #2294, #2357, #2553 & #2748, we have a bit of work to do in that area. :-)

这篇关于EntityFramework 7 (EF7) 迁移.DbContext 和 StartUp Project 在不同的程序集中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆