Skip to content

Commit 0b81ec3

Browse files
author
Nathan Bridgewater
committed
added primary key attribute
1 parent b8eaa10 commit 0b81ec3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

SubSonic-T4-Helpers/Entities_Initial.tt

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ namespace <#=Namespace #>
2424
<#
2525
foreach(Column col in table.Columns)
2626
{
27+
if (col.IsPK && col.CleanName.ToLower() != "id")
28+
{
29+
#> [SubSonicPrimaryKey]
30+
<# }
31+
2732
var nullableNonString = string.Empty;
2833
var nullableString = string.Empty;
2934
if (col.IsNullable && col.SysType != "string")
@@ -53,4 +58,4 @@ namespace <#=Namespace #>
5358
<# SaveOutput(table.CleanName + ".cs");
5459
}
5560
#>
56-
}
61+
}

0 commit comments

Comments
 (0)