Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework 4 Repository?

I am learning Entity Framework 4, and I want to use the Repository pattern to organize and isolate my persistence objects. I have done some research here and elsewhere on the web, and I am having a difficult time finding anything really useful on the subject. Most of the blogs look like simple ports of repositories from other ORM systems, with lots of contradictory advice. Most seem to pass the object context to the business layer, which would seem to defeat the purpose of a repository approach.

Can anyone suggest a good article, book, or blog the explains how to implement the Repository pattern with Entity Framework 4, without polluting the business layer with persistence objects? Thanks for your help.

like image 953
David Veeneman Avatar asked Mar 23 '11 19:03

David Veeneman


1 Answers

Here is a list of bookmarks I have about this topic. I prefer a combination of approaches given in these so unfortunately I don't have a single pick.

http://www.primaryobjects.com/CMS/Article122.aspx

https://github.com/geersch/EntityFrameworkObjectContext

http://blogs.microsoft.co.il/blogs/gilf/archive/2010/06/21/revisiting-the-repository-and-unit-of-work-patterns-with-entity-framework.aspx

http://blogs.msdn.com/b/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx

http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/

http://www.codeproject.com/KB/database/ImplRepositoryPatternEF.aspx

http://elegantcode.com/2009/12/15/entity-framework-ef4-generic-repository-and-unit-of-work-prototype/

http://www.mindscapehq.com/blog/index.php/2008/05/12/using-the-unit-of-work-per-request-pattern-in-aspnet-mvc/

http://mfelicio.wordpress.com/2010/02/07/managing-the-entity-framework-objectcontext-instance-lifetime-in-wcf-and-sharing-it-among-repositories/

http://www.west-wind.com/weblog/posts/246222.aspx

like image 94
amit_g Avatar answered Oct 04 '22 06:10

amit_g