Skip to content

Commit

Permalink
added primary key attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Bridgewater committed Oct 4, 2010
1 parent b8eaa10 commit 0b81ec3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SubSonic-T4-Helpers/Entities_Initial.tt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ namespace <#=Namespace #>
<# <#
foreach(Column col in table.Columns) foreach(Column col in table.Columns)
{ {
if (col.IsPK && col.CleanName.ToLower() != "id")
{
#> [SubSonicPrimaryKey]
<# }

var nullableNonString = string.Empty; var nullableNonString = string.Empty;
var nullableString = string.Empty; var nullableString = string.Empty;
if (col.IsNullable && col.SysType != "string") if (col.IsNullable && col.SysType != "string")
Expand Down Expand Up @@ -53,4 +58,4 @@ namespace <#=Namespace #>
<# SaveOutput(table.CleanName + ".cs"); <# SaveOutput(table.CleanName + ".cs");
} }
#> #>
} }

0 comments on commit 0b81ec3

Please sign in to comment.