zoukankan      html  css  js  c++  java
  • 动软生成Model(dapper.common)

    <#@ template language="c#" HostSpecific="True" #>
    <#@ output extension= ".cs" #>
    <#
    TableHost host = (TableHost)(Host);
    host.Fieldlist.Sort(CodeCommon.CompareByintOrder);
    #>
    using Dapper.Common;
    using System;
    using System.Collections.Generic;
    using System.Text;
    namespace Review.Model.AccountModel
    {
    <# if( host.TableDescription.Length > 0) {#>
    //<#= host.TableDescription #>
    <# } #>
    [Table("<#= host.GetModelClass(host.TableName) #>")]
    public class <#= host.GetModelClass(host.TableName) #>
    {

    <# foreach (ColumnInfo c in host.Fieldlist)
    { #>/// <summary>
    /// <#= string.IsNullOrEmpty(c.Description) ? c.ColumnName : c.Description #>
    /// </summary>
    <# if (c.IsPrimaryKey)
    {#>
    [Column(name: "<#=c.ColumnName#>", key: ColumnKey.Primary, isIdentity: true, isColumn: true)]
    <#}
    else{
    #>
    [Column(name: "<#=c.ColumnName#>")]
    <#}#>
    public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>{ get; set; }

    <# } #>


    }
    }

  • 相关阅读:
    性能测试相关
    centos7 设置定时器 crond
    大杀器Bitset
    树形DP
    双线程DP
    状态压缩DP
    斜率优化DP
    01分数规划
    二分和三分
    uva11549 Floyd判圈法
  • 原文地址:https://www.cnblogs.com/tonglei/p/11245873.html
Copyright © 2011-2022 走看看