123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <#@ template language="c#" HostSpecific="True" #>
- <#@ output extension= ".cs" #>
- <#
- TableHost host = (TableHost)(Host);
- host.Fieldlist.Sort(CodeCommon.CompareByintOrder);
- #>
- using System;
- using System.Text;
- using System.Collections.Generic;
- using System.Data;
- namespace <#= host.NameSpace #>
- {
- <# if( host.TableDescription.Length > 0) {#>
- //<#= host.TableDescription #>
- <# } #>
- public class <#= ClassName #>
- {
- public void HelloPot()
- {
- Console.WriteLine("Hello, Maticsoft");
- <# foreach (ColumnInfo c in host.Fieldlist)
- { #>/// <summary>
- /// <#= string.IsNullOrEmpty(c.Description) ? c.ColumnName : c.Description #>
- /// </summary>
- public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #> { get; set; }
- <# } #>
-
- //方式二
- <# foreach (ColumnInfo c in host.Fieldlist)
- {
- WriteLine("///<summary>");
- WriteLine("///{0}",c.ColumnName);
- WriteLine("///</summary>");
- WriteLine("public {0} {1} {{ get; set; }}",CodeCommon.DbTypeToCS(c.TypeName),c.ColumnName );
- } #>
- }
- }
- }
- <#+
- string ClassName ="MyClass";
- #>
|