I'm working on updating our CodeTemplates folder with t4 scaffolds in ASP.NET MVC 5, which we use for generating controllers and views. All of my individual controller/view scaffolds work, but I'm looking for a way to add additional views which aren't typically included when generating a controller.
For example, if I want to add a new controller, I'll click "Add Controller > MVC 5 Controller with views, using Entity FrameWork" and select my model class "Department." The t4 files generate a DepartmentsController and 5 views: Create, Delete, Details, Edit, and Index.
However, I have a t4 scaffold for a view called Table that I'd like to generate at the same time.
Currently, I can work around it by adding the Table view manually after I've made the Departments controller, but what I'd like to happen is that I add the Departments controller and a Table view is generated in addition to the 5 other views. Is there any way to do this?
I've skimmed through the microsoft docs on t4 scaffolds but didn't find anything related particularly to this. I also tried looking into generating multiple files from a single t4 scaffold, but I haven't had much luck.
Let me know if there's any additional info that might be helpful or if you have any other questions! I'd love some help or recommendations on where to look for this.
Update 12/9/19: I didn't find any way to do this and neither did my coworkers/supervisor. we did a work-around to generate the Table file from our Index file and place it in the correct directory, then include the file manually into the project when scaffolding a controller.