Skip to content

Generic Repository and Unit of Work Pattern With Entity Framework 6

Notifications You must be signed in to change notification settings

codeBestard/EntityFramework6_DAL_Template

Repository files navigation

Entity Framework 6 DAL Template

Generic Repository and Unit of Work Pattern With Entity Framework 6

Introduction

The Repository Pattern is one of the most popular patterns in an N Layered application. An example of N layer system may consists of Presentation Layer, Service layer, Business Layer and Data Access Layer. The Repository is an abstraction on top of the Data Access layer. Using Repository/Unit of work pattern, we can hide EF implementation from business layer, and thus it makes our code more test friendly.

If you plan to use Entity Framework Core, please checkout Repository and unit of work patterns for EF Core and In-Memory Database Provider.

Pre-reqs and Main Libraries

Steup

  1. Open the project/solution in Visual Studio, and open the console using the **Tools > NuGet Package Manager > Package Manager Console command

  2. Enable DB migration

$ Add-Migration init
  1. Create dabase
$ Update-Database –Verbose

About

Generic Repository and Unit of Work Pattern With Entity Framework 6

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages