Part 57- Repository Pattern- 4 - Adding Data Access Layer OR Repository Layer
In this tutorial, You will learn about how to add Data Access/Repository Layer under repository pattern implementation in Asp.net MVC . In Repository pattern I will create different layers but it depends on you whether you need this or not. You can directly create Data Access Layer and create the generic repository methods into this. I will explain generic repository in my upcoming videos. Lets look at below layers
1. Web Layer is your MVC web Project
2. Business Layer consist the CRUD operation, gets data from Data Access Layer, Manipulate them and finally returns data to the Controller ( Web Layer)
3. Domain Layer consist the Domain Models or Classes that hold the data coming from Data Access Layer. Both Web and Business Layer can use domain models to exchange data.
4. Data Access Layer consist the generic repository methods (generic CRUD operation), Unit of Work( Database Context) and NON Generic repository( User defined repository).
Please Like, Share and subscribe our Channel. Have a great day.
1. Web Layer is your MVC web Project
2. Business Layer consist the CRUD operation, gets data from Data Access Layer, Manipulate them and finally returns data to the Controller ( Web Layer)
3. Domain Layer consist the Domain Models or Classes that hold the data coming from Data Access Layer. Both Web and Business Layer can use domain models to exchange data.
4. Data Access Layer consist the generic repository methods (generic CRUD operation), Unit of Work( Database Context) and NON Generic repository( User defined repository).
#How to create Data Access Layer?
# How to add Entities into Data Access Layer?
Please follow below steps
A. (Right click on project then add new item)
B . (Select ADO.NET Entity Data Model and give any name)
C . (Choose EF Designer then Next)
D . (Click on New Connection and Add Server and database. Then Click next)
E . (Select Server and Database then click on test connection and ok)
F . (Check the dbo checkbox and give a meaningful name and finish)
G . (You are done !!!)
Note: In video I explained how to access above entity into Business Layer. But that was just to extra knowledge. I am going to access this entity framework in generic and custom repository methods in next tutorial.
What Next => In next tutorial we will learn how to create Generic Repository Methods with UnitOfWork and how to use above Entities.
Please Like, Share and subscribe our Channel. Have a great day.
0 Response to "Part 57- Repository Pattern- 4 - Adding Data Access Layer OR Repository Layer"
Post a Comment