EF 4.1+ POCO, Repository and Specification Pattern Framework

added by wladek
5/22/2012 8:49:15 AM

3 Kicks, 945 Views

I've been playing around with Code First EF implementations for awhile now and by far the best implementation I've seen is a framework by Huy Rua. It has the following functionality baked in: True Separation of Concerns for entities (no need for a data annotations dependency). A Generic Repository. This should do the trick for 80% of your standard CRUD operations without the need for repo's per entity. Supports multiple DbContext's and builds them dynamically. And finally a straightforward Specification pattern implementation. I use it as a base data layer for all my projects.


1 comments

dpeterson
5/22/2012 8:48:57 AM
Direct links in case you missed them the first time like I did ;-)
https://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/
https://huyrua.wordpress.com/2010/08/25/specification-pattern-in-entity-framework-4-revisited/

I don't use the repository pattern much myself. The specification pattern is pretty interesting though, seems like a nice way to add an abstraction over your querying capabilities.