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

Commit 77246da

Browse files
committed
Add additional underscore on encountering a duplicate cleaned property name
1 parent 9ba18c7 commit 77246da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/T4/OrmLite.Poco.tt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,14 @@ manager.StartNewFile(tbl.Name + ".cs");
7171
}
7272

7373
<# }
74+
var priorProperyNames = new List<string>();
7475
foreach(Column col in from c in tbl.Columns where !c.Ignore select c)
7576
{
77+
if (priorProperyNames.Contains(col.PropertyName)) //Change duplicate style names
78+
{
79+
col.PropertyName = "_" + col.PropertyName;
80+
}
81+
priorProperyNames.Add(col.PropertyName);
7682
if ((col.Name!=col.PropertyName) || (col.IsPK && UseIdAsPK)) { #>
7783
[Alias("<#=col.Name#>")]
7884
<# } if (col.PropertyType == "string" && col.Size > 0) { #>
@@ -101,5 +107,3 @@ foreach(Column col in from c in tbl.Columns where !c.Ignore select c)
101107
<#manager.EndBlock(); #>
102108
<#manager.Process(SplitIntoMultipleFiles); #>
103109
<# } #>
104-
105-

0 commit comments

Comments
 (0)