修复排序错误
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using SqlSugar;
|
||||
using Tnb;
|
||||
|
||||
namespace JNPF.Common.Contracts;
|
||||
|
||||
public class BaseEntity<TKey> : IEntity where TKey : IEquatable<TKey>
|
||||
public class BaseEntity<TKey> : Entity, IEntity where TKey : IEquatable<TKey>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 编号.
|
||||
@@ -10,6 +11,8 @@ public class BaseEntity<TKey> : IEntity where TKey : IEquatable<TKey>
|
||||
[SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true)]
|
||||
public TKey id { get; set; }
|
||||
|
||||
|
||||
|
||||
public override object[] GetKeys()
|
||||
{
|
||||
return [id];
|
||||
}
|
||||
}
|
||||
|
||||
30
common/Tnb.Common/Contracts/Entity.cs
Normal file
30
common/Tnb.Common/Contracts/Entity.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// 宁波拓通e智造平台 ToTong Next Builder //
|
||||
// https://git.tuotong-tech.com/tnb/tnb.server //
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using JNPF.Common.Contracts;
|
||||
|
||||
namespace Tnb;
|
||||
|
||||
[Serializable]
|
||||
public abstract class Entity : IEntity
|
||||
{
|
||||
protected Entity()
|
||||
{
|
||||
//EntityHelper.TrySetTenantId(this);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[ENTITY: {GetType().Name}] Keys = {string.Join(", ", GetKeys())}";
|
||||
}
|
||||
|
||||
public abstract object[] GetKeys();
|
||||
|
||||
//public bool EntityEquals(IEntity other)
|
||||
//{
|
||||
// return EntityHelper.EntityEquals(this, other);
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user