Repository and Unit of Work Patterns in an ASP.NET MVC Application
Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application The repository and unit of work patterns are intended to create an abstraction layer between the data access layer and the business logic layer of an application. Implementing these patterns can help insulate your application from changes in the data store and can facilitate automated unit testing or test-driven development (TDD). In this tutorial you'll implement a repository class for each entity type. For the Employee entity type you'll create a repository interface and a repository class. When you instantiate the repository in your controller, you'll use the interface so that the controller will accept a reference to any object that implements the repository interface. When the controller runs under a web server, it receives a repository that works with the Entity Framework . When the controller runs under a unit test class, it receives a repository that works with data stored ...