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.
53 lines
1.3 KiB
53 lines
1.3 KiB
using Apewer.Internals;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Apewer.Source
|
|
{
|
|
|
|
/// <summary>数据库中的表。</summary>
|
|
[Serializable]
|
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)]
|
|
public sealed class TableAttribute : Attribute
|
|
{
|
|
|
|
private string _name;
|
|
private bool _independent = false;
|
|
|
|
/// <summary></summary>
|
|
public TableAttribute(string name = null)
|
|
{
|
|
_name = TableStructure.RestrictName(name, string.IsNullOrEmpty(name));
|
|
}
|
|
|
|
/// <summary></summary>
|
|
internal TableAttribute(string name, bool underline)
|
|
{
|
|
_name = TableStructure.RestrictName(name, underline);
|
|
}
|
|
|
|
/// <summary></summary>
|
|
public string Name
|
|
{
|
|
get { return _name; }
|
|
set { _name = TableStructure.RestrictName(value, false); }
|
|
}
|
|
|
|
/// <summary></summary>
|
|
public bool Independent
|
|
{
|
|
get { return _independent; }
|
|
internal set { _independent = value; }
|
|
}
|
|
|
|
/// <summary></summary>
|
|
public override int GetHashCode()
|
|
{
|
|
return _name.GetHashCode();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|