列特性:
[AttributeUsageAttribute(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public class ColumAttribute : Attribute
{
private string _columName;
private DbType _dbType ;
public ColumAttribute()
{
}
public ColumAttribute(string columName)
: this()
{
this._columName = columName;
}
public ColumAttribute(string columName, DbType dbType)
: this(columName)
{
this._dbType = dbType;
}
//列名
public virtual string ColumName
{
set
{
this._columName = value;
}
get
{
return this._columName;
}
}
//描述一些特殊的數據庫類型
public DbType DbType
{
get { return _dbType; }
set { _dbType = value; }
}
}