EF 4.1 Pocos中的UnitOfWork + Generic Repository模式 [英] UnitOfWork + Generic Repository pattern in EF 4.1 Pocos

查看:93
本文介绍了EF 4.1 Pocos中的UnitOfWork + Generic Repository模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在使用EF 4.1和Pocos开展项目。

I am working on a project using EF 4.1 with Pocos.

实施该项目的最佳方法是什么UnitOfWork + Generic Repository模式呢?

What is the best way to implement the UnitOfWork + Generic Repository pattern to it?

我一直在阅读一些文章但主要使用的是EF 3.5,而且通常不是Generic Repository。

I have been reading a few articles but mostly uses EF 3.5 and usually not Generic Repository.

谢谢,

Miguel

推荐答案

我在code.msdn上有一个WCF RIA服务示例一个工作单元/存储库模式与EF 4.1 (好吧,有点,我发现IDbSet< T>本身非常适合作为一个通用的存储库接口,我在我的UoW界面中表现出来)。您可以在此处查看示例:
http://code.msdn.microsoft.com/Task-based-MVVM-Sample-for-2eb86fab

另外,我也喜欢Daniel Cazzulino的解决方案:
http://blogs.clariusconsulting.net/kzu/how-to-design-a-unit-testable-domain-model-with-entity-framework-code-first/

Alternatively, I also like Daniel Cazzulino's solution: http://blogs.clariusconsulting.net/kzu/how-to-design-a-unit-testable-domain-model-with-entity-framework-code-first/

希望有帮助

Remco


这篇关于EF 4.1 Pocos中的UnitOfWork + Generic Repository模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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