Search code examples
asp.net-mvctemplatesrazorviewscaffolding

How create your own ASP.NET MVC scaffolding template for views?


How create and use your own ASP.NET MVC scaffolding template? In "add Controller" wizard there is an "template" option with Microsoft templates. I would like to add new ones. A customized one. is that possible?

enter image description here

edit

In Visual Studio 2015 there is no template option anymore.

enter image description here


Solution

  • You can modify the T4 templates used by Visual Studio. This is a good article on how to do it:

    https://www.credera.com/blog/technology-insights/microsoft-solutions/create-custom-scaffold-templates-asp-net-mvc/

    You copy the default templates into your project "CodeTemplates" folder. You can then alter the templates without affecting the defaults.