using System; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace Hncore.Infrastructure.DDD { /// /// 实现模型抽象基类 /// /// 主键数据类型 public abstract class Entity : IEntity { /// /// 记录数据库主键ID /// [JsonProperty("Id")] public virtual TId Id { get; set; } } public abstract class EntityWithTime : Entity { /// /// 记录添加(创建)时间 /// public virtual DateTime CreateTime { get; set; } = DateTime.Now; /// /// 记录最后更新时间 /// public virtual DateTime UpdateTime { get; set; } = DateTime.Now; /// /// 记录软删除标记,0.代表正常,1.代表已删除 /// public virtual int DeleteTag { get; set; } } public abstract class EntityWithDelete : Entity,ISoftDelete { /// /// 记录软删除标记,0.代表正常,1.代表已删除 /// public virtual int DeleteTag { get; set; } = 0; } }