Question

In Visual Studio 2012 with an ASP.net MVC 4 project type, when you add a controller you can make it generate CRUD pages for a selected entity. Is there anyway to get it to use the repository pattern in the controllers as you can when you use the Package Manager to do the same task?

At the moment it news up the data context in the controller.

enter image description here

Was it helpful?

Solution

Use nuget to install the mvcscaffolding package - latest version is 1.0.9. Now in the list of templates you have also "MvcScaffolding: Controller with read/write action and views, using repositories".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top