using System; using SqlSugar; using System.ComponentModel; using Myshipping.Core.Entity; namespace Myshipping.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.DataType!="string"&&column.IsNullable?"?":"") @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.DataType!="string"&&column.IsNullable?"?":"") @column.DbColumnName { get; set; } } } } }