Import Directive

Top  Previous  Next

T4 Import Directive

 

   <#@ import namespace="namespace" #>

 

 

The import directive allows you to refer to types within a text template without providing a fully qualified name. The “namespace” parameter is transformed into a .Net “using” directive in the compiled template.

 

Example:

 

<#@ import namespace=”System.Collections.Generic” #>

<#@ import namespace=”System” #>

<#@ import namespace=”SoftVelocity.TextTemplating” #>

<#@ import namespace=”System.Drawing” #>

<#@ import namespace=”System.Drawing.Design” #>

<#@ import namespace=”SoftVelocity.DataDictionary.Design” #>