我们可以通过一个类的Type的GetCustomAttributes方法来读取这个类上所附加的特性。
class KeyAttribute : Attribute{ } //定义特性(标签)
[KeyAttribute] //打上特性(标签)
public int Key { get; set; }
读取到类所对应的表的特性了,接下来我们该读取类里包含的属性上所附加的ColumAttribute特性了
private static PropertyInfo[] propInfos = null;
private static List
propPrimarys =
new List
();
//保存主键列
private
static List
primaryColums =
new Lis