#region Copyright (C) 2014 OS系列开源项目
/*
文件功能描述:验证属性attribute
创建人:王超
创建人Email:1985088337@qq.com
创建日期:2014.08.25
修改描述:
*/
#endregion
using System;
using System.Reflection;
namespace OS.Common.Extention.DTO
{
#region 类型属性的自定义属性处理
///
/// 别名属性
///
public class ColumnAliasAttribute : BaseClumnAttribute
{
///
///
///
///
public ColumnAliasAttribute(string alias)
{
_alias = alias;
}
}
///
/// 别名属性
///
public class IgnoreColumnAttribute : BaseClumnAttribute
{
///
///
///
public IgnoreColumnAttribute()
{
_IsIgnore = false;
}
}
///
/// 自增长属性
///
public class AutoColumnAttribute : BaseClumnAttribute
{
///
///
///
public AutoColumnAttribute()
{
_IsAuto = true;
}
}
///
/// 列属性封装基类
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field
| AttributeTargets.Property | AttributeTargets.GenericParameter,
AllowMultiple = false, Inherited = true)]
public class BaseClumnAttribute : Attribute
{
protected string _alias;
///
/// 列简称
///
public String Alias
{
get { return _alias; }
}
protected bool _IsAuto;
///
/// 是否是自增长列
///
public bool IsAuto
{
get { return _IsAuto; }
}
protected bool _IsIgnore;
///
/// 是否忽略当前列
///
public bool IsIgnore
{
get { return _IsIgnore; }
}
}
///
/// 列属性信息
///
public class PropertyColumnInfo
{
///
/// 属性名称
///
public string Name { get; set; }
///
/// 列别名
///
public string Alias { get; set; }
///
/// 是否自增长
///
public bool IsAuto { get; set; }
///
/// 是否忽略当前列
///
public bool IsIgnore { get; set; }
///
/// 列属性信息
///
public PropertyInfo PropertyInfo { get; set; }
}
#endregion
}