using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
namespace Ant.ORM
{
///
/// 字段标签
///
[AttributeUsage(AttributeTargets.Property)]
public class DataFieldColumnAttribute : Attribute
{
private string name;
///
/// 列名
///
public string Name
{
get { return name; }
set { name = value; }
}
private DbType dbType;
///
/// 类型
///
public DbType DbType
{
get { return dbType; }
set { dbType = value; }
}
private object defaultValue;
///
/// 默认值
///
public object DefaultValue
{
get { return defaultValue; }
set { defaultValue = value; }
}
private bool isPrimaryKey = false;
///
/// 是否为主键
///
public bool IsPrimaryKey
{
get { return isPrimaryKey; }
set { isPrimaryKey = value; }
}
private bool isForeignKey = false;
///
/// 是否为外键
///
public bool IsForeignKey
{
get { return isForeignKey; }
set { isForeignKey = value; }
}
private bool isNullable = true;
///
/// 是否为空
///
public bool IsNullable
{
get { return isNullable; }
set { isNullable = value; }
}
private bool isAutoincrement = false;
///
/// 是否为自动增长
///
public bool IsAutoincrement
{
get { return isAutoincrement; }
set { isAutoincrement = value; }
}
public DataFieldColumnAttribute(string name, DbType dbType)
{
this.name = name;
this.DbType = dbType;
}
}
}