-
Notifications
You must be signed in to change notification settings - Fork 334
/
CustomerMapper.tt
28 lines (28 loc) · 1.04 KB
/
CustomerMapper.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<#@ template debug="true" language="C#" #>
<#@ output extension=".g.cs" #>
<# /*@ Assembly Name="/usr/local/share/dotnet/sdk/2.2.103/Microsoft/Microsoft.NET.Build.Extensions/net461/lib/netstandard.dll" */ #>
<#@ Assembly Name="netstandard" #>
<#@ Assembly Name="System.Core" #>
<#@ Assembly Name="System.Runtime" #>
<#@ Assembly Name="System.Linq.Expressions" #>
<#@ Assembly Name="$(TargetDir)/$(ProjectName).dll" #>
<#@ Assembly Name="$(TargetDir)/Mapster.dll" #>
<#@ Assembly Name="$(TargetDir)/ExpressionTranslator.dll" #>
<#@ import namespace="Benchmark.Classes" #>
<#@ import namespace="ExpressionDebugger" #>
<#@ import namespace="Mapster" #>
<#
TypeAdapterConfig.GlobalSettings.SelfContainedCodeGeneration = true;
var foo = default(Customer);
var def = new ExpressionDefinitions
{
IsStatic = true,
MethodName = "Map",
Namespace = "Benchmark",
TypeName = "CustomerMapper"
};
var code = foo.BuildAdapter()
.CreateMapExpression<CustomerDTO>()
.ToScript(def);
WriteLine(code);
#>