Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist – Infragistics Microsoft MVP

Similar presentations


Presentation on theme: "How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist – Infragistics Microsoft MVP"— Presentation transcript:

1 How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist – Infragistics Microsoft MVP http://debugmode.net http://debugmode.net

2 Some Information  Webinar recording will be available on http://www.infragistics.com/community/blogs/dhananjay_kumar/defa ult.aspx http://www.infragistics.com/community/blogs/dhananjay_kumar/defa ult.aspx  Visit http://www.infragistics.com/ for all the products details.http://www.infragistics.com/  Tweet us @infragistics for your experience  Please reach out to us at Sales-India@infragistics.com for any follow up questions you may have. We welcome the opportunity to assist you.Sales-India@infragistics.com

3 Share your experience by tweeting and Facebook with hashtag #Infragistics or mention to @infragistics

4 Host : Dhananjay Kumar  Developer Evangelist – Infragistics  6 times Microsoft MVP  @debug_mode  Blog : http://debugmode.net http://debugmode.net  Email : Dkumar@infragistics.comDkumar@infragistics.com

5 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

6 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

7 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

8 Project Structure

9 ProjectResponsibilityType 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 ProjectMVC based web application using Infrastructure and Core projects libraries using Dependency Injection MVC

10 Let us write Code step by step to implement Repository Pattern

11 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/downloadhttp://www.infragistics.com/products/ultimate/download Please reach out to us at Sales-India@infragistics.com for any follow up questions you may have. We welcome the opportunity to assist you.Sales-India@infragistics.com


Download ppt "How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist – Infragistics Microsoft MVP"

Similar presentations


Ads by Google