using Furion.DatabaseAccessor; using Microsoft.EntityFrameworkCore; using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; namespace YBEE.EQM.Core { /// /// 自定义实体基类 /// public abstract class DEntityBase : DEntityBase { } public abstract class DEntityBase : DEntityBase { } public abstract class DEntityBase : PrivateDEntityBase where TDbContextLocator1 : class, IDbContextLocator { } public abstract class PrivateDEntityBase : IPrivateEntity { /// /// 主键 /// [Comment("主键")] [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public virtual TKey Id { get; set; } /// /// 创建时间 /// [Comment("创建时间")] [Required] public virtual DateTime CreateTime { get; set; } /// /// 更新时间 /// [Comment("更新时间")] public virtual DateTime? UpdateTime { get; set; } /// /// 创建人ID /// [Comment("创建人ID")] [Required] public virtual int CreateSysUserId { get; set; } /// /// 修改者Id /// [Comment("修改者Id")] public virtual int? UpdateSysUserId { get; set; } /// /// 软删除 /// [Comment("软删除标记")] [Required, JsonIgnore] public virtual bool IsDeleted { get; set; } = false; /// /// 一对一引用(创建人) /// public virtual SysUser CreateSysUser { get; set; } /// /// 一对一引用(更新人) /// public virtual SysUser UpdateSysUser { get; set; } } }