C# net PDMan/CHINER/元数建模 生成Dapper 代码生成器模板
C# net PDMan/CHINER/元数建模 生成Dapper代码模板
C# net PDMan CHINER 元数建模 生成 Dapper 代码生成器 代码模板
在版本>=4.0.0版本中 增加分类 代码生成器 >> C# >> Dapper
$blankline {{ var today=new Date(); var fullYear=today.getFullYear(); var month=today.getMonth() + 1; var days=today.getDate(); var dapperTable='[Table("{{=it.entity.defKey}}")]'; }} /// <summary> /// {{=it.func.join(it.entity.defName,it.entity.comment,';')}} /// </summary> {{=dapperTable}} public class {{=it.func.camel(it.entity.defKey,true)}} { {{~it.entity.fields:field:index}} /// <summary> /// {{=it.func.join(field.defName,field.comment,';')}} /// </summary> {{? field.primaryKey }} [ExplicitKey] {{?}} public {{=field.type}}{{? field.type!='string'&&!field.notNull}}?{{?}} {{=field.defKey}}{ get; set; } {{~}} }
生成的效果如下:
/// <summary> /// 测试记录 /// </summary> [Table("TestRecord")] public class TestRecord { /// <summary> /// ID /// </summary> [ExplicitKey] public string Id { get; set; } /// <summary> /// 项目Id /// </summary> public string ProjectId { get; set; } /// <summary> /// 项目名称 /// </summary> public string ProjectName { get; set; } /// <summary> /// 行号(原点为右下) /// </summary> public int? RowNum { get; set; } /// <summary> /// 列号(原点为右下) /// </summary> public int? ColumnNum { get; set; } /// <summary> /// 创建时间 /// </summary> public DateTime? CreatedTime { get; set; } }
ok!
如有问题请联系QQ:
var d=["1","2","3","4","5","6","7","8","9"];
var pass=d[8]+d[6]+d[0]+d[8]+d[2]+d[0]+d[4]+d[3]+d[2];
源代码(github)包(NuGet)关注:ping9719