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.

26 lines
882 B

3 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Apewer.Source
  5. {
  6. /// <summary>数据库记录通用字段模型,此模型中的 Key 属性带有主键特性。</summary>
  7. /// <remarks>带有 Independent 特性的模型不包含此类型声明的属性。</remarks>
  8. [Serializable]
  9. public abstract class KeyRecord : Record
  10. {
  11. /// <summary>记录主键,一般使用 GUID 的字符串形式。</summary>
  12. /// <remarks>
  13. /// <para>注:</para>
  14. /// <para>1. 默认长度为 32,需要修改长度时应该重写此属性;</para>
  15. /// <para>2. 带有 Independent 特性的模型不包含此属性。</para>
  16. /// </remarks>
  17. [PrimaryKey]
  18. [Column("_key", ColumnType.NVarChar, 32)]
  19. public override string Key { get => base.Key; set => base.Key = value; }
  20. }
  21. }