Entity.cmt 1013 B

12345678910111213141516171819202122232425262728293031323334
  1. <#@ template language="c#" HostSpecific="True" #>
  2. <#@ output extension= ".cs" #>
  3. <#
  4. TableHost host = (TableHost)(Host);
  5. host.Fieldlist.Sort(CodeCommon.CompareByintOrder);
  6. #>
  7. using System;
  8. //Nhibernate Code Generation Template 1.0
  9. //author:MythXin
  10. //blog:www.cnblogs.com/MythXin
  11. //Entity Code Generation Template
  12. namespace <#= host.NameSpace #>.Entity<# if( host.Folder.Length > 0) {#>.<#= host.Folder #><# } #>
  13. {
  14. <# if( host.TableDescription.Length > 0) {#>
  15. //<#= host.TableDescription #>
  16. <# } #>
  17. public class <#= host.GetModelClass(host.TableName) #>
  18. {
  19. <# foreach (ColumnInfo c in host.Fieldlist)
  20. { #>/// <summary>
  21. /// <#= string.IsNullOrEmpty(c.Description) ? c.ColumnName : c.Description #>
  22. /// </summary>
  23. public virtual <#= CodeCommon.DbTypeToCS(c.TypeName) #><# if(c.Nullable) { #><#if(CodeCommon.isValueType(CodeCommon.DbTypeToCS(c.TypeName
  24. ))){ #>?<# }#><# }#> <#= c.ColumnName #>
  25. {
  26. get;
  27. set;
  28. }
  29. <# } #>
  30. }
  31. }