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

Était-ce utile?

La 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".

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top