Instead of this .tt:
<#@ template debug=\"false\" hostspecific=\"true\" language=\"C#\" #>
<#@ import namespace=\"System.IO\" #>
<#@ output extens
This is an alternative solution not using class feature blocks <#+ ... #>
.
Using a lambda expression inside usual statement blocks <# ... #>
allows defining a local function as follows:
<#@ template language="C#" #>
<#@ output extension=".txt" #>
<# Action output = () => { #>
loooooooong text <#= "message" #>
<# }; #>
<# output(); #>
This template produces the output below:
loooooooong text message