Question

I have created a custom template as follows:

Scaffold CustomTemplate View Index

As a result, I now have a local T4 template:

enter image description here

I made some modifications to the template. My question is how to generate code only for the view. I have done the following which works but which in my opinion is overkill since all I want is for my view to be generated.

Scaffold Controller -ModelType Task -ControllerName TasksController -DbContextType TasksDbContext -Repository -Force
Was it helpful?

Solution

I've managed to find out what command to pass:

Scaffold View -ModelType Task -Controller Tasks -ViewName Index -Template Index -Force

What I didn't know about was the -Template string switch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top