문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top