When using T4 to generate C # code, I cannot get the correct identification with the TABS scattered around:
public partial class Foo : Base
{
public int C { get; set; }
[MappedProperty("A.B[{C}].Foo")]
public int Foo { get; set; }
}
I am using a seemingly correctly typed .TT code similar to the following:
public partial class <#= ViewModelName #>
{
<# foreach(var property in ViewModelProperties) { #>
<# if(property.Mapping != null) { #>
[MappedProperty("<#= property.Mapping #>")]
<# } #>
public <#= property.TypeDeclaration #> <#= property.MemberName #> { get; set; }
<# } #>
}
This piece of code reflects what I have already tried to do: simplify control statements and blocks in one line as much as possible.
source
share