赖素文
authored
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{
<# foreach (var item in TableColumnInfos) #>
<# { #>
<# if (item.ColumnName.Equals("id",StringComparison.OrdinalIgnoreCase)) #>
<# { #>
/// <summary>
/// 主键
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
<# } #>
<# else { if (!string.IsNullOrWhiteSpace(item.ColumnDescription)) #>
<# { #>
/// <summary>
/// <#=item.ColumnDescription #>
/// </summary>
<# } #>
[SugarColumn(<#= item.TypeName.Equals("string", StringComparison.OrdinalIgnoreCase) ? $"Length = {item.TypeLenght}, " : "" #><#= string.IsNullOrWhiteSpace(item.ColumnDescription) ? "" : $"ColumnDescription = \"{item.ColumnDescription}\", " #>IsNullable = <#= item.NullAble ? "true" : "false" #>)]
<# } #>
public <#=item.TypeName #> <#=item.ColumnName #> { get; set; }
<# } #>
}
}
|