How to set parameters for included T4 templates?

55 Views Asked by At

If I have a reusable T4 template, how can I set parameters when recalling it?

Consider these two example files...

Hello.t4:

<#@ parameter type="System.String" name="Name" #>
Hello <#= this.Name #>!

HelloWorld.tt:

Testing text templates,
<#@ include file="Hello.t4" #>

How to pass the string "World" as the "Name" parameter of the Hello.t4 template?

0

There are 0 best solutions below