Universal Repository

we does use frequently repository design pattern in the asp.net mvc.We use them into Controllers and codes classes like IRepository,BaseRepository.This classes is generic classes.Each Repository class(concrete repository) inherited BaseRepository and uses with related Controller.In there Actually directly using Controller class is not true.we should definition BaseController.

Let’s take a look a below class-diagram

ClassDiagram1

If benefits of Universal Repository class is centralize production(new instance)  of concrete repository.Let’s look at the code now

Now let’s look at how to use

Untitled

i think that was helpful

Leave a Reply

Your email address will not be published. Required fields are marked *