From 4695c7d371e91ee5a7228d80c6f15aca1ab7a410 Mon Sep 17 00:00:00 2001 From: Takasakiii Date: Tue, 7 Nov 2023 13:06:21 -0300 Subject: [PATCH] add: clone entity --- Lina/Database/Models/BaseEntity.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lina/Database/Models/BaseEntity.cs b/Lina/Database/Models/BaseEntity.cs index 947fd0f..24aa97b 100644 --- a/Lina/Database/Models/BaseEntity.cs +++ b/Lina/Database/Models/BaseEntity.cs @@ -10,4 +10,10 @@ public abstract class BaseEntity /// Entity id /// public TPkType Id { get; set; } = default!; + + public T Clone() + where T: BaseEntity + { + return (T)MemberwiseClone(); + } } \ No newline at end of file