zoukankan      html  css  js  c++  java
  • model类生成模板

    <#@ template language="c#" HostSpecific="True" #>
    <#@ output extension= ".cs" #>
    <#
    	TableHost host = (TableHost)(Host);
    	host.Fieldlist.Sort(CodeCommon.CompareByintOrder);
    #>
    using System;
    namespace <#= host.NameSpace #><# if( host.Folder.Length > 0) {#>.<#= host.Folder #><# } #>
    
    {
    	<# if( host.TableDescription.Length > 0) {#>//<#= host.TableDescription #>
    	<# } #>public class <#= host.GetModelClass(host.TableName).Replace("Sys_","")+"Entity" #>: IEntity<<#= host.GetModelClass(host.TableName).Replace("Sys_","")+"Entity" #>>, ICreationAudited, IDeleteAudited, IModificationAudited
    	{		
          	<# foreach (ColumnInfo c in host.Fieldlist)
    		{ #>/// <summary>
    		/// <#= string.IsNullOrEmpty(c.Description) ? c.ColumnName : c.Description #>
            /// </summary>
            <#if(CodeCommon.DbTypeToCS(c.TypeName)=="bool" || CodeCommon.DbTypeToCS(c.TypeName)=="DateTime"){#>private <#= CodeCommon.DbTypeToCS(c.TypeName) #>? _<#= c.ColumnName.ToString().ToLower() #>;
    		public <#= CodeCommon.DbTypeToCS(c.TypeName) #>? <#= c.ColumnName #>
    		<#}else{#>private <#= CodeCommon.DbTypeToCS(c.TypeName) #> _<#= c.ColumnName.ToString().ToLower() #>;
    		public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>
    		<#}#>{
                get{ return _<#= c.ColumnName.ToString().ToLower()#>; }
                set{ _<#= c.ColumnName.ToString().ToLower() #> = value; }
            }        
    		<# } #>
       
    	}
    }
    

      

  • 相关阅读:
    $Noip2011/Luogu1311$ 选择客栈
    $Noip2013/Luogu1970$ 花匠 $dp$+思维
    $CF1063B Labyrinth$ $01$最短路/$01BFS$
    $UVA10559 Blocks $区间$dp$
    $SCOI2009 windy$数 数位$dp$
    $cometoj#4 D $求和 不是$dp$
    Manacher算法总结
    题解 P1537 【弹珠】
    题解 P4609 【[FJOI2016]建筑师】
    字符串专题随笔
  • 原文地址:https://www.cnblogs.com/moxiaomai/p/8915694.html
Copyright © 2011-2022 走看看