📄 dataobjectattribute.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
namespace MiniORMAttribute
{
[Serializable]
public class DataObjectAttribute : Attribute
{
private string _TableName;
private string _Key;
private string _ForeignKey;
public DataObjectAttribute(string tablename) : this(tablename,"")
{ }
public DataObjectAttribute(string tablename, string key) : this(tablename,key,"")
{ }
/// <summary>
/// 构造函数
/// </summary>
/// <param name="tablename">实体对应的数据库表名</param>
/// <param name="key">实体的PrimaryKey</param>
/// <param name="foreignkey">实体的ForeignKey</param>
public DataObjectAttribute(string tablename, string key, string foreignkey)
{
this._TableName = tablename;
this._Key = key;
this._ForeignKey = foreignkey;
}
/// <summary>
/// 对应的数据库表
/// </summary>
public string TableName
{
get { return _TableName; }
}
/// <summary>
/// 本对象对于的数据库Key
/// </summary>
public string Key
{
get { return _Key; }
}
/// <summary>
/// 本记录对应的ForeignKey
/// </summary>
public string ForeignKey
{
get { return _ForeignKey; }
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -