Permalink
Browse files

added primary key attribute

  • Loading branch information...
nathanb committed Oct 4, 2010
1 parent b8eaa10 commit 0b81ec3b16b181b78897abf98514b05c082f097a
Showing with 6 additions and 1 deletion.
  1. +6 −1 SubSonic-T4-Helpers/Entities_Initial.tt
@@ -24,6 +24,11 @@ namespace <#=Namespace #>
<#
foreach(Column col in table.Columns)
{
+ if (col.IsPK && col.CleanName.ToLower() != "id")
+ {
+#> [SubSonicPrimaryKey]
+<# }
+
var nullableNonString = string.Empty;
var nullableString = string.Empty;
if (col.IsNullable && col.SysType != "string")
@@ -53,4 +58,4 @@ namespace <#=Namespace #>
<# SaveOutput(table.CleanName + ".cs");
}
#>
-}
+}

0 comments on commit 0b81ec3

Please sign in to comment.