From 1149871948aebd8fb5e93f755f0b1a9f8cf69dd3 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 5 Nov 2024 23:51:58 +0800 Subject: [PATCH] updated models --- src/Infrastructure/IDeleteable.cs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/Infrastructure/IDeleteable.cs b/src/Infrastructure/IDeleteable.cs index 86ae522..970b548 100644 --- a/src/Infrastructure/IDeleteable.cs +++ b/src/Infrastructure/IDeleteable.cs @@ -6,4 +6,35 @@ public interface IDeletable { bool IsDeleted { get; set; } +} + +public interface IPrimaryKey where T : IEquatable +{ + public T Id { get; set; } +} + +public interface IEntityBase : IPrimaryKey, IDeletable where T : IEquatable +{ + public DateTime CreatedDate { get; set; } + + public DateTime? UpdatedDate { get; set; } + + public string? Name { get; set; } + + public T CreatorId { get; set; } +} + +public abstract class EntityBase : IEntityBase where T : class, IEquatable +{ + public bool IsDeleted { get; set; } + + public T Id { get; set; } + + public DateTime CreatedDate { get; set; } + + public string? Name { get; set; } + + public DateTime? UpdatedDate { get; set; } + + public T CreatorId { get; set; } } \ No newline at end of file