Template

In the following example you can see a simple T4 template that can be used as a template in every Scaffold Module of the Emeraude Client Builder.

<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="Emeraude.Application.ClientBuilder.Shared" #>
<#=ClientBuilderConstants.AutoGeneratedHeaderText #>

<# foreach (var constantsGroup in (Dictionary<string, Dictionary<string, string>>)Session["Constants"]) { #>
// <#=constantsGroup.Key#>
<# foreach (var constant in constantsGroup.Value) { #>
export const <#=constant.Key#> = <#=constant.Value#>;
<# } #>

<# } #>

IMPORTANT

T4 templates must be defined for runtime rendering with custom tool option value - TextTemplatingFilePreprocessor. Indicator for the proper template working is the existing of related class for the template file.