parameters ?

Jun 4, 2012 at 1:29 PM


How do the parameters work ?

How to pass parameters to template ?



Thank you

Jun 4, 2012 at 7:41 PM


in your template file add one or more parameter directives:
<#@ parameter name="parameterA" type="int" #>
<#@ parameter name="parameterB" type="string" #>

Create an instance of the generator:
IGenerator gen = new Generator();

Finally pass the parameters through the Generate method in the same sequence as they appear in the template file:
gen.Generate( "MyTemlate.t4", textWriter, 1234, "aString" );

Hope this helps



Jun 4, 2012 at 8:50 PM

Very good :-)

i am going to test this


Thank you very much !