how to implement the repository pattern in an asp.net mvc application dhananjay kumar developer...
DESCRIPTION
Share your experience by tweeting and Facebook with hashtag #Infragistics or mentionTRANSCRIPT
![Page 1: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/1.jpg)
How to implement the Repository Pattern in an ASP.NET MVC Application
Dhananjay KumarDeveloper Evangelist – Infragistics Microsoft MVP http://debugmode.net
![Page 2: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/2.jpg)
Some Information Webinar recording will be available on http://
www.infragistics.com/community/blogs/dhananjay_kumar/default.aspx
Visit http://www.infragistics.com/ for all the products details.
Tweet us @infragistics for your experience
Please reach out to us at [email protected] for any follow up questions you may have. We welcome the opportunity to assist you.
![Page 3: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/3.jpg)
Share your experience by tweeting and Facebook with hashtag #Infragistics or mention to @infragistics
![Page 4: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/4.jpg)
Host : Dhananjay Kumar
Developer Evangelist – Infragistics
6 times Microsoft MVP @debug_mode
Blog : http://debugmode.net
Email : [email protected]
![Page 5: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/5.jpg)
Agenda• What is Repository Pattern • Advantages of Repository Pattern• Step by Step implementing Repository
pattern • Creating Core Project • Creating Infrastructure Project • Creating Test Project • Creating MVC Project
![Page 6: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/6.jpg)
Advantage of Repository Pattern
Business logic can be unit tested without data access logic
Database access code can be reused
Database access code is centrally managed so easy to implement any database access policies such that caching
Easy to implement domain logics
Domain entities or business entities are strongly typed with the annotations
![Page 7: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/7.jpg)
Some of the difficulties Duplicate code
Difficulty implementing any data related logic or policies such that caching
Difficulty in unit testing the business logic without having the data access layer
Tightly coupled business logic and database access logic
![Page 8: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/8.jpg)
Project Structure
![Page 9: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/9.jpg)
Project Structure Project Responsibility Type
Core Project Domain entities and interface for database operations
Class library
Infrastructure Project Libraries to perform database operations. Such as Entity Framework library.
Class library
Test Project Unit Tests for Infrastructure projects
Unit Test
MVC Project MVC based web application using Infrastructure and Core projects libraries using Dependency Injection
MVC
![Page 10: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/10.jpg)
Let us write Code step by step to implement Repository Pattern
![Page 11: How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist Infragistics Microsoft MVP](https://reader035.vdocuments.mx/reader035/viewer/2022081803/5a4d1b807f8b9ab0599baa65/html5/thumbnails/11.jpg)
What Infragistics can offer you?• We welcome all of you to take advantage of a FREE 30 Day Trial by downloading
the product at: http://www.infragistics.com/products/ultimate/download
• Please reach out to us at [email protected] for any follow up questions you may have. We welcome the opportunity to assist you.