pmf pmf - 10 months ago 66
C# Question

T4 Templates: How to create a subtemplate?

Is there a way I can create a subtemplate within a template file in T4? I need to reuse a snippet of template within the same template and a embedded function does not allow template based reuse.

Answer Source

You can use include.

<#@ include file="AnotherTemplate.tt" #>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download