Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Feb 20, 2012 03:36 PM|LINK
Can anybody explain me what are the benefits of Repository and Unit of work pattern? What are the benefits of Entity Framework code first approach?
Misunderstand just not aware your Q
The Repository pattern assists in separating data storage concerns from the application logic. This pattern is especially beneficial when you use the ADO.NET Entity Framework because it allows you to hide ADO.NET Entity Framework-specific classes such as
DbContext and DbSet, to optimize the shape of the data returned to the application, to coordinate updates, and to unit test your application without requiring access to physical data storage.
A repository is a set of interfaces and implementations providing methods for data access. The interfaces do not expose any types specific to data storage. You can choose how many repositories to create based on how granularly you want to control data access
within your application.
The only purpose is that share the same context. Why?e.g: To prevent to perform multiple task at the same time.A few context try to update, insert, delete database item. If so the app will be hang or might error.