Skip to content

Commit

Permalink
add: clone entity
Browse files Browse the repository at this point in the history
  • Loading branch information
Takasakiii committed Nov 7, 2023
1 parent 1700a19 commit 4695c7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lina/Database/Models/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ public abstract class BaseEntity<TPkType>
/// Entity id
/// </summary>
public TPkType Id { get; set; } = default!;

public T Clone<T>()
where T: BaseEntity<TPkType>
{
return (T)MemberwiseClone();
}
}

0 comments on commit 4695c7d

Please sign in to comment.