EF 6加几个分贝上下文 [英] EF 6 plus several db contexts

查看:109
本文介绍了EF 6加几个分贝上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看着像<一个问题href=\"http://stackoverflow.com/questions/11197754/entity-framework-one-database-multiple-dbcontexts-is-this-a-bad-idea\">this我倾向于不使用几个dbcontexts。但是,它仍然会是不错的看一些例子code。任何人是否知道一个企业级的开源实现(C#),使用几个dbcontexts和工作(和潜在的asp.net MVC)的单位的?

Looking at questions like this I am inclined not to use several dbcontexts. However, it would still be nice to have a look at some example code. Is anyone aware of an enterprise level open source implementation (c#) that uses several dbcontexts and unit of work (and potentially asp.net mvc)?

推荐答案

当你已经使用这个词的企业我将在朱莉·勒曼,谁拥有多个DbContexts的一些很好的覆盖面从这个角度点你DDD的有界上下文。

As you have used the word Enterprise I would point you at Julie Lerman, who has some nice coverage of multiple DbContexts from the perspective of DDD bounded contexts.

下面有一个相对较新的MSDN文章,她写的关于这个问题:的http:// msdn.microsoft.com/en-us/magazine/jj883952.aspx

Heres a relatively recent MSDN article she's written on this subject: http://msdn.microsoft.com/en-us/magazine/jj883952.aspx.

她也有一个梦幻般的系列,涵盖企业利用实体框架,包括使用多个上下文对Pluralsight截屏。我不会有任何的联系,因为这是一个付费的服务。

She also has a fantastic series of screencasts on Pluralsight that cover enterprise use of Entity Framework, including the use of multiple contexts. I wont include any links as this is a paid-for service.

从code样品的角度看,看看对微软模式与放大器参考CQRS架构;它使用有限的上下文(如多DbContexts)做法来分解一个复杂的系统到不同的领域。 http://msdn.microsoft.com/en-us/library/jj554200.aspx

From a code sample perspective, take a look at the reference CQRS architecture on the Microsoft Patterns & Practices which uses bounded contexts (as multiple DbContexts) to decompose a complex system into separate domains. http://msdn.microsoft.com/en-us/library/jj554200.aspx

code为参考CQRS架构是在这里:的 https://github.com/mspnp/cqrs-journey-$c$c

希望一些这证明对你有用。

Hope some of this proves useful to you.

这篇关于EF 6加几个分贝上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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