0

I'm using VS 2015 with EF 6.1.3. with MVC5. I know that MVC5 scaffolding templates are located in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates\

But I cant use them since standard scaffolding is not an option for me. I would like to generate similar views and controllers against my custom POCO classes eg. ViewModels that are located in BL. Can you run and customize those (or some other) templates so that they could generate MVC controllers and views from some other classes or repository?

vipasane
  • 355
  • 2
  • 10

2 Answers2

1

Here's a good general article for custom scaffold templates in MVC

https://www.credera.com

http://www.c-sharpcorner.com

https://www.youtube.com/watch?v=YIr18d5wBXM

May be it's helpful for you.

ANJYR
  • 2,583
  • 6
  • 39
  • 60
1

If you are already use to T4 template syntax you can try out my extension T4 Awesome. It adds a lot of UI to visual studio for running templates and supports parameters, one of which is a code type that allows you to use POCO class metadata inside your templates. This would allow you to generate views and controller stubs much like scaffolding does but in a very quick way. In scaffolding you have to build/test/compile/deploy your scaffolds, its almost like working on another project altogether. With T4 Awesome, all you do is create your templates and use them, edit as needed, and this all happens within the same solution as your code. Full disclaimer, there is a charge for using the advanced features but I do have a community edition that will do what you want and is free for forever.

Frank
  • 2,178
  • 2
  • 17
  • 24