62,075
社区成员
发帖
与我相关
我的任务
分享
[AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
public class ColumnAttribute:Attribute
{
private string _columnName;
private SqlDbType _dbType;
private bool _allowDbNull;
private bool _isIdentity;
private bool _isPrimary;
private byte _precision;
private byte _scale;
private int _size;
public ColumnAttribute(string columnName, SqlDbType dbType)
{
this._columnName = columnName;
this._dbType = dbType;
}
public string ColumnName
{
get { return _columnName; }
}
public SqlDbType DbType
{
get { return _dbType; }
}
public bool AllowDbNull
{
set { _allowDbNull = value; }
get { return _allowDbNull; }
}
public bool IsIdentity
{
set { _isIdentity = value; }
get { return _isIdentity; }
}
public bool IsPrimary
{
set { _isPrimary = value; }
get { return _isPrimary; }
}
public byte Precision
{
set { _precision = value; }
get { return _precision; }
}
public byte Scale
{
set { _scale = value; }
get { return _scale; }
}
public int Size
{
set { _size = value; }
get { return _size; }
}
}
public class TestDal:BaseDal
{
public TestDal()
{
}
[Column("column",System.Data.SqlDbType.Int)]
public QueryItem item = new QueryItem();
}