Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit d468678

Browse files
committed
Made easier to turn on/off via //Settings at the top
1 parent a71d9d5 commit d468678

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/T4/OrmLite.Poco.tt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
bool SplitIntoMultipleFiles = false; // if true: Generates one file for every class
99
bool MakeSingular = true; // if true: Changes the classname to singular if tablename is not singular
1010
bool UseIdAsPK = true; // if true: Changes the primary key property name to Id
11-
bool GenerateConstructor = false; // if true: Generates the default empty constructor
11+
bool GenerateConstructor = false; // if true: Generates the default empty constructor
12+
bool UseSchemaAttribute = true; // if true: Adds explicit '[Schema]' attribute
1213

1314
// Read schema
1415
var tables = LoadTables(MakeSingular);
@@ -58,6 +59,8 @@ manager.StartNewFile(tbl.Name + ".cs");
5859
#>
5960
<# if (MakeSingular) {#>
6061
[Alias("<#=tbl.Name#>")]
62+
<#}#>
63+
<# if (UseSchemaAttribute) {#>
6164
[Schema("<#=tbl.Schema#>")]
6265
<#}#>
6366
public partial class <#=tbl.ClassName#><#if (tbl.HasPK() && UseIdAsPK) { #> : IHasId<<#=tbl.PK.PropertyType#>><#}#>

0 commit comments

Comments
 (0)