1
- <#@ include file="OrmLite.Core.ttinclude" #>
1
+ <#@ include file="OrmLite.Core.ttinclude" #>
2
2
<#
3
3
// Settings
4
- ConnectionStringName = ""; // Uses last connection string in config if not specified
5
- Namespace = "";
6
- RepoName = "";
7
- GenerateOperations = true;
8
- GeneratePocos = true;
9
- GenerateCommon = true;
4
+ ConnectionStringName = "PressDB"; // Uses last connection string in config if not specified
5
+ Namespace = "IQM.Data";
10
6
ClassPrefix = "";
11
7
ClassSuffix = "";
12
- TrackModifiedColumns = false ;
8
+ bool SplitIntoMultipleFiles = true ;
13
9
14
10
// Read schema
15
11
var tables = LoadTables();
30
26
#>
31
27
<#
32
28
if (string.IsNullOrEmpty(Namespace)) Namespace=ConnectionStringName;
33
- if (string.IsNullOrEmpty(RepoName) && !string.IsNullOrEmpty(ConnectionStringName)) RepoName=ConnectionStringName + "DB";
34
29
if (string.IsNullOrEmpty(Namespace)) Namespace="OrmLitePoco";
35
- if (string.IsNullOrEmpty(RepoName)) RepoName="PocoDB";
36
- #>
30
+ var manager = Manager.Create(Host, GenerationEnvironment);
31
+ manager.StartHeader(); #>// <auto-generated />
32
+ // This file was generated by a T4 template.
33
+ // Don't change it directly as your change would get overwritten. Instead, make changes
34
+ // to the .tt file (i.e. the T4 template) and save it to regenerate this file.
35
+
36
+ // Make sure the compiler doesn't complain about missing Xml comments
37
+ #pragma warning disable 1591
38
+
37
39
using System;
38
40
using System.Collections.Generic;
39
41
using System.Linq;
@@ -45,11 +47,13 @@ using ServiceStack.DesignPatterns.Model;
45
47
46
48
namespace <#=Namespace #>
47
49
{
50
+ <#manager.EndBlock(); #>
48
51
<#
49
52
foreach(Table tbl in from t in tables where !t.Ignore select t)
50
53
{
54
+ manager.StartNewFile(tbl.Name + ".cs");
51
55
#>
52
-
56
+
53
57
[Alias("<#=tbl.Name#>")]
54
58
public partial class <#=tbl.ClassName#><#if (tbl.HasPK()) { #> : IHasId<<#=tbl.PK.PropertyType#>><#}#>
55
59
{
@@ -71,8 +75,13 @@ foreach(Column col in from c in tbl.Columns where !c.Ignore select c)
71
75
<#}#>
72
76
<# } #>
73
77
}
74
- <# } #>
78
+ <# manager.EndBlock(); #>
79
+ <# } #>
80
+ <#manager.StartFooter(); #>
75
81
}
76
- <# } #>
82
+ #pragma warning restore 1591
83
+ <#manager.EndBlock(); #>
84
+ <#manager.Process(SplitIntoMultipleFiles); #>
85
+ <# } #>
77
86
78
87
0 commit comments