Search code examples
asp.net-mvcrepositoryasp.net-mvc-viewmodel

a controller with multiple repositories in ASP.Net MVC 3


I have a controller which controls a view which is a criteria search page. The view has a search criteria section at the top and a grid section at the bottom which will display the results from the search. I have two repositories in my controller, one for Common stuff like combobox values which is associated with Criteria section. The other repository is for the grid data. I create a viewmodel with both repositories and pass it to my view (as my model) which makes my Model really huge. Is there any better way of doing this?


Solution

  • It is better to use Unit of Work and Repository