第一步,先声明特性类:
public static class DataMap {
public const string NotMapped = "NotMapped";
}
//描述数据库字段的 Attribute
public class DataFieldAttribute : Attribute {
public DataFieldAttribute(string fieldName, string fieldType) {
this._fieldName = fieldName;
this._fieldType = fieldType;
}
public DataFieldAttribute(string annotations) {
this._annotations = annotations;
}
// 数据库字段名
private string _fieldName;
public string FieldName {
get { return _fieldName; }
set { _fieldName = value; }
}
// 数据库字段类型
private string _fieldType;
public string FieldType {
<