You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace HealthMonitor.Util.Entities.Interfaces
- {
- public interface IEntity
- {
- /// <summary>
- /// 获取全局(数据库内)唯一键
- /// </summary>
- /// <param name="key">需要赋予实体键的值</param>
- /// <returns></returns>
- string GetUniqueKey(string? key = null);
-
- /// <summary>
- /// 获取全局(数据库内)唯一键(通过实体的主键创建,而不会创建随机键)
- /// </summary>
- /// <returns></returns>
- string GetRequiredUniqueKey();
-
- /// <summary>
- /// 获取主键(数据表内唯一)
- /// </summary>
- /// <returns></returns>
- string GetPrimaryKey();
-
- /// <summary>
- /// 为实体的键(标记了KeyAttribute)属性赋值
- /// </summary>
- /// <param name="key"></param>
- void AssignEntityKey(string key);
-
- /// <summary>
- /// 断言实体类参数各个字段值符合要求
- /// </summary>
- void AssertValidate();
- }
- }
|