You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
2.3 KiB
Plaintext
46 lines
2.3 KiB
Plaintext
2 years ago
|
using System;
|
||
|
using SqlSugar;
|
||
|
using System.ComponentModel;
|
||
|
using Myshipping.Core.Entity;
|
||
|
namespace Myshipping.Application.Entity
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// @(@Model.Description)
|
||
|
/// </summary>
|
||
|
[SugarTable("@(@Model.TableName)")]
|
||
|
[Description("@(@Model.Description)")]
|
||
|
public class @(@Model.EntityName) @Model.BaseClassName
|
||
|
{
|
||
|
@foreach (var column in Model.TableField){
|
||
|
if(@Model.BaseClassName=="" && @column.IsPrimarykey){
|
||
|
@:/// <summary>
|
||
|
@:/// @column.ColumnDescription
|
||
|
@:/// </summary>
|
||
|
@:[Description("@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){
|
||
|
@:/// <summary>
|
||
|
@:/// @column.ColumnDescription
|
||
|
@:/// </summary>
|
||
|
@:[Description("@column.ColumnDescription")]
|
||
|
@:public @column.DataType@(column.DataType!="string"&&column.IsNullable?"?":"") @column.DbColumnName { get; set; }
|
||
|
}
|
||
|
else if(@Model.BaseClassName!="" && @column.IsPrimarykey && @column.DbColumnName.ToLower()!="id"){
|
||
|
@:/// <summary>
|
||
|
@:/// @column.ColumnDescription
|
||
|
@:/// </summary>
|
||
|
@:[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"){
|
||
|
@:/// <summary>
|
||
|
@:/// @column.ColumnDescription
|
||
|
@:/// </summary>
|
||
|
@:[Description("@column.ColumnDescription")]
|
||
|
@:public @column.DataType@(column.DataType!="string"&&column.IsNullable?"?":"") @column.DbColumnName { get; set; }
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|