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

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