Unisys provides a set of scaffold templates that are used while scaffolding your application. Refer to Scaffold Templates for information on the provided templates. Each scaffold template is implemented using the Microsoft Text Template Transformation Toolkit (T4). For more information on T4, search for the topic “Code Generation and T4 Text Templates” at http://msdn.microsoft.com.
You can create a custom scaffold template to change the code that is generated when you scaffold your application. The easiest way to do this is to copy one of the existing Unisys scaffold templates and provide your own name for the T4 file.
Note: Do not edit the Unisys-supplied T4 files directly; instead make a copy of the T4 file and edit the copy. Unisys might provide future updates to the NuGet packages that contain the scaffold templates. If you install these updated NuGet packages, the existing Unisys-supplied T4 files will be overwritten, and your changes will be lost.
To use your own custom scaffold template based on a Unisys-supplied scaffold template, do the following:
In Solution Explorer, navigate to the folder containing the scaffold template you wish to copy (Code Templates/AddService, Code Templates/AddController or Code Templates/AddView).
Right-click the T4 file and select Copy.
Right-click the folder and click Paste.
Click on the new file and rename it to an appropriate name, such as My Controller.t4 or My View.t4.
Double-click the new T4 file to open it in the editor.
Edit the new T4 file as needed.
Scaffold your application. Refer to Invoking Scaffolders for more information. When you select the Service scaffolder, Controller scaffolder or View scaffolder, you should see the name of your new scaffold template (without the .T4 extension) in the dropdown list. Select your new scaffold template.