Generic Repository Pattern
NWBI, Ièm having some trouble with using or implementing a Generic Repository Patter. with Linq To Entities. I'm inheriting a legacy application with object based crud operations,开发者_Go百科 I would like to create a Generic Factory to Entities based on the object type being passed in
http://geekswithblogs.net/seanfao/archive/2009/12/03/136680.aspx
http://dotnetslackers.com/articles/ado_net/Managing-Entity-Framework-ObjectContext-lifespan-and-scope-in-n-layered-ASP-NET-applications.aspx
download the code (from dotnetslackers), it use entity framework 3.5, but at least you will have a fair idea how to start.
精彩评论