[英]How do I create an in memory DbContext with Entity Framework 6?
How do I create an in memory version of a DbContext for testing in entity framework 6?如何创建 DbContext 的内存版本以在实体框架 6 中进行测试? I cannot use .NET core for this project, it must be ef 6. I already have a custom db context created that connects to sql server and works great.
我不能在这个项目中使用 .NET 核心,它必须是 ef 6。我已经创建了一个自定义 db 上下文,它连接到 sql server 并且运行良好。
Doing this in .NET core is trivial, I am hoping something exists for legacy entity framework / .NET framework as well, but so far no luck on my searches...在 .NET 核心中执行此操作是微不足道的,我希望遗留实体框架/.NET 框架也存在一些东西,但到目前为止我的搜索没有运气......
您可以尝试使用此 EF6 内存中提供程序: https : //entityframework-effort.net/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.