首页 > 数据库技术 > 详细

动软生成器添加Mysql注释

时间:2020-02-05 14:26:01      阅读:77      评论:0      收藏:0      [点我收藏+]

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

动软生成器添加Mysql注释

原文:https://www.cnblogs.com/dj1232090/p/12263275.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!