From 325035031bcc28beffb7e7426ac78994bdeece64 Mon Sep 17 00:00:00 2001 From: Takasakiii Date: Mon, 13 May 2024 20:04:40 -0300 Subject: [PATCH] fix: "Why does a person who defends access level have access problems?" --- .../Interfaces/IBaseEntity.cs | 7 ++----- TakasakiStudio.Lina.Database/Models/BaseEntity.cs | 13 +++++++++++++ .../Models/BaseValidatedEntity.cs | 13 +++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/TakasakiStudio.Lina.Database/Interfaces/IBaseEntity.cs b/TakasakiStudio.Lina.Database/Interfaces/IBaseEntity.cs index e181a5f..d3f81da 100644 --- a/TakasakiStudio.Lina.Database/Interfaces/IBaseEntity.cs +++ b/TakasakiStudio.Lina.Database/Interfaces/IBaseEntity.cs @@ -6,14 +6,11 @@ public interface IBaseEntity /// Entity id /// public TPkType Id { get; set; } - + /// /// Create a clone of value /// /// Value type /// - public T Clone() - { - return (T)MemberwiseClone(); - } + public T Clone(); } \ No newline at end of file diff --git a/TakasakiStudio.Lina.Database/Models/BaseEntity.cs b/TakasakiStudio.Lina.Database/Models/BaseEntity.cs index e5552f0..ceede11 100644 --- a/TakasakiStudio.Lina.Database/Models/BaseEntity.cs +++ b/TakasakiStudio.Lina.Database/Models/BaseEntity.cs @@ -8,5 +8,18 @@ namespace TakasakiStudio.Lina.Database.Models; /// Entity id type public abstract class BaseEntity : IBaseEntity { + /// + /// Entity id + /// public TPkType Id { get; set; } = default!; + + /// + /// Create a clone of value + /// + /// Value type + /// + public T Clone() + { + return (T)MemberwiseClone(); + } } \ No newline at end of file diff --git a/TakasakiStudio.Lina.Database/Models/BaseValidatedEntity.cs b/TakasakiStudio.Lina.Database/Models/BaseValidatedEntity.cs index 50efb63..d8c1dc4 100644 --- a/TakasakiStudio.Lina.Database/Models/BaseValidatedEntity.cs +++ b/TakasakiStudio.Lina.Database/Models/BaseValidatedEntity.cs @@ -10,5 +10,18 @@ namespace TakasakiStudio.Lina.Database.Models; /// Entity id type public abstract class BaseValidatedEntity : BaseValidated, IBaseEntity { + /// + /// Entity id + /// public TPkKey Id { get; set; } = default!; + + /// + /// Create a clone of value + /// + /// Value type + /// + public T Clone() + { + return (T)MemberwiseClone(); + } } \ No newline at end of file