zeroframework/Services/DeviceCenter/ZeroFramework.DeviceCenter.Domain/Entities/BaseEntity.cs
2023-12-05 17:22:48 +08:00

20 lines
423 B
C#

using System.Diagnostics.CodeAnalysis;
namespace ZeroFramework.DeviceCenter.Domain.Entities
{
public abstract class BaseEntity
{
public abstract object[] GetKeys();
}
public abstract class BaseEntity<TKey> : BaseEntity
{
[AllowNull]
public TKey Id { get; set; }
public override object[] GetKeys()
{
return new object[] { Id! };
}
}
}