数据库
首页 > 数据库> > 动软生成器添加Mysql注释

动软生成器添加Mysql注释

作者:互联网

1.解决没有mysql注释问题

替换原文件下载地址

2.更新Models模板

<#@ template language="c#" HostSpecific="True" #>
<#@ output extension= ".cs" #>
<#
    TableHost host = (TableHost)(Host);
    host.Fieldlist.Sort(CodeCommon.CompareByintOrder);
#>
using Dapper.Extension;
using System; 
using System.Text;
using System.Collections.Generic; 
using System.Data;
using Newtonsoft.Json;
namespace <#= host.NameSpace #>.Models<# if( host.Folder.Length > 0) {#>.<#= host.Folder #><# } #>
{
    <# 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>        
        [JsonProperty("<#= c.ColumnName.ToString().ToLower() #>")]
        public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName.Substring(0,1).ToUpper()+c.ColumnName.Substring(1) #>{ get; set; }
        <# } #>
   
    }
}

转载:https://www.cnblogs.com/Jerrycjc/p/9176885.html

标签:Models,生成器,System,注释,动软,Mysql,using,public
来源: https://www.cnblogs.com/dj1232090/p/12263275.html