22 lines
611 B
22 lines
611 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Apewer.Source
|
|
{
|
|
|
|
/// <summary>表示此属性对应的字段是主键。</summary>
|
|
[AttributeUsage(AttributeTargets.Property)]
|
|
public sealed class PrimaryKeyAttribute : Attribute
|
|
{
|
|
|
|
/// <summary>从 <see cref="PrimaryKeyAttribute"/> 到 Boolean 的隐式转换,判断 <see cref="PrimaryKeyAttribute"/> 有效。</summary>
|
|
public static implicit operator bool(PrimaryKeyAttribute instance)
|
|
{
|
|
if (instance == null) return false;
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|