How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist – Infragistics Microsoft MVP
Some Information Webinar recording will be available on ult.aspx ult.aspx Visit for all the products details. Tweet for your experience Please reach out to us at for any follow up questions you may have. We welcome the opportunity to assist
Share your experience by tweeting and Facebook with hashtag #Infragistics or mention
Host : Dhananjay Kumar Developer Evangelist – Infragistics 6 times Microsoft MVP Blog :
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
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
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
Project Structure
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
Let us write Code step by step to implement Repository Pattern
What Infragistics can offer you? We welcome all of you to take advantage of a FREE 30 Day Trial by downloading the product at: Please reach out to us at for any follow up questions you may have. We welcome the opportunity to assist