1

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

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189

1 Answers1

1

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

Jan Roelof
  • 531
  • 5
  • 3
  • Do you know where there's a list of the Scaffolding commands available? – Ian Warburton Jun 11 '13 at 11:42
  • 1
    @IanWarburton You can find all commands and an explanation of what they do at: http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/ – Erik Schierboom Jun 11 '13 at 13:06