using System;
using SqlSugar;
using System.ComponentModel;
using Magic.Core.Entity;
namespace Magic.Application.Entity
{
///
/// @(@Model.Description)
///
[SugarTable("@(@Model.TableName)")]
[Description("@(@Model.Description)")]
public class @(@Model.EntityName) @Model.BaseClassName
{
@foreach (var column in Model.TableField){
if(@Model.BaseClassName=="" && @column.IsPrimarykey){
@:///
@:/// @column.ColumnDescription
@:///
@:[SugarColumn(IsIdentity = @column.IsIdentity.ToString().ToLower(), ColumnDescription = "@column.ColumnDescription", IsPrimaryKey = true)]
@:public @column.DataType @column.DbColumnName { get; set; }
}
else if(@Model.BaseClassName=="" && !@column.IsPrimarykey){
@:///
@:/// @column.ColumnDescription
@:///
@:public @column.DataType @column.DbColumnName { get; set; }
}
else if(@Model.BaseClassName!="" && @column.IsPrimarykey && @column.DbColumnName.ToLower()!="id"){
@:///
@:/// @column.ColumnDescription
@:///
@:[SugarColumn(IsIdentity = @column.IsIdentity.ToString().ToLower(), ColumnDescription = "@column.ColumnDescription", IsPrimaryKey = true)]
@:public @column.DataType @column.DbColumnName { get; set; }
}
else if(@Model.BaseClassName!="" && !@column.IsPrimarykey && @column.DbColumnName.ToLower()!="id"){
@:///
@:/// @column.ColumnDescription
@:///
@:public @column.DataType @column.DbColumnName { get; set; }
}
}
}
}