Add new Custom T4 template in Add New Controller D

2020-07-17 02:29发布

问题:

I want to implement new T4 templates which should appear under Scaffold options in Add New Controller Dialog.

I have tried adding a new View tt template.I was able to add it. I need a reference where I can get basic information on how to create a new Controller template rather than modifying existing one.

Thanks Patil

回答1:

Have you had a look at MVCScaffolding? http://nuget.org/packages/MVCScaffolding/

You can easily override the controller t4 template using MVCScaffolding: http://blog.stevensanderson.com/2011/04/06/mvcscaffolding-overriding-the-t4-templates/