mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
24
OpenAuth.Repository/Core/BaseEntity.cs
Normal file
24
OpenAuth.Repository/Core/BaseEntity.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace OpenAuth.Repository.Core
|
||||
{
|
||||
public abstract class BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 判断主键是否为空,常用做判定操作是【添加】还是【编辑】
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract bool KeyIsNull();
|
||||
|
||||
/// <summary>
|
||||
/// 创建默认的主键值
|
||||
/// </summary>
|
||||
public abstract void GenerateDefaultKeyVal();
|
||||
|
||||
public BaseEntity()
|
||||
{
|
||||
if (KeyIsNull())
|
||||
{
|
||||
GenerateDefaultKeyVal();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user