增加基础表SugarBasicTable2定义

This commit is contained in:
FalconFly 2023-11-22 14:30:51 +08:00
parent a9a592463d
commit 803449bcaa
2 changed files with 27 additions and 2 deletions

View File

@ -12,13 +12,13 @@ namespace Falcon.SugarApi.DatabaseDefinitions
/// <summary>
/// 主键
/// </summary>
[SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键")]
[SugarColumn(IsPrimaryKey = true,ColumnDescription = "主键")]
public Guid Id { get; set; } = Guid.NewGuid();
/// <summary>
/// 创建时间
/// </summary>
[Required]
[SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")]
[SugarColumn(IsOnlyIgnoreUpdate = true,ColumnDescription = "创建时间")]
public DateTime CreateTime { get; set; } = DateTime.Now;
/// <summary>

View File

@ -0,0 +1,25 @@
using SqlSugar;
using System;
using System.ComponentModel.DataAnnotations;
namespace Falcon.SugarApi.DatabaseDefinitions
{
/// <summary>
/// 数据表基类
/// </summary>
public abstract class SugarBasicTable2
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(IsPrimaryKey = true,ColumnDescription = "主键")]
public string Id { get; set; } = "";
/// <summary>
/// 创建时间
/// </summary>
[Required]
[SugarColumn(ColumnDescription = "创建时间")]
public DateTime CreateTime { get; set; } = DateTime.Now;
}
}