Skip to content

Commit

Permalink
fix: "Why does a person who defends access level have access problems?"
Browse files Browse the repository at this point in the history
  • Loading branch information
Takasakiii committed May 13, 2024
1 parent d9882f5 commit 3250350
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
7 changes: 2 additions & 5 deletions TakasakiStudio.Lina.Database/Interfaces/IBaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ public interface IBaseEntity<TPkType>
/// Entity id
/// </summary>
public TPkType Id { get; set; }

/// <summary>
/// Create a clone of value
/// </summary>
/// <typeparam name="T">Value type</typeparam>
/// <returns></returns>
public T Clone<T>()
{
return (T)MemberwiseClone();
}
public T Clone<T>();
}
13 changes: 13 additions & 0 deletions TakasakiStudio.Lina.Database/Models/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,18 @@ namespace TakasakiStudio.Lina.Database.Models;
/// <typeparam name="TPkType">Entity id type</typeparam>
public abstract class BaseEntity<TPkType> : IBaseEntity<TPkType>
{
/// <summary>
/// Entity id
/// </summary>
public TPkType Id { get; set; } = default!;

/// <summary>
/// Create a clone of value
/// </summary>
/// <typeparam name="T">Value type</typeparam>
/// <returns></returns>
public T Clone<T>()
{
return (T)MemberwiseClone();
}
}
13 changes: 13 additions & 0 deletions TakasakiStudio.Lina.Database/Models/BaseValidatedEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,18 @@ namespace TakasakiStudio.Lina.Database.Models;
/// <typeparam name="TPkKey">Entity id type</typeparam>
public abstract class BaseValidatedEntity<TModel, TPkKey> : BaseValidated<TModel>, IBaseEntity<TPkKey>
{
/// <summary>
/// Entity id
/// </summary>
public TPkKey Id { get; set; } = default!;

/// <summary>
/// Create a clone of value
/// </summary>
/// <typeparam name="T">Value type</typeparam>
/// <returns></returns>
public T Clone<T>()
{
return (T)MemberwiseClone();
}
}

0 comments on commit 3250350

Please sign in to comment.