A generic implementation of the Repository Pattern with Unit of Work in C# and EF6.
Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
Benefits
- Minimizes duplicate query logic
- Decouples your application from persistence frameworks
Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
Benefits
- Manage transactions
- Ensures that when using multiple repositories, they share a single database context
Martin Fowler - Repository - Unit of Work