public ExFieldInfo SearchExField(string name) { var fieldArray = MType.GetFields(); foreach (FieldInfo field in fieldArray) { if (ReflectionUtil.IsDeclare(MType, field)) { CodeAttribute propertyAttr = Attribute.GetCustomAttribute(field, typeof(CodeAttribute)) as CodeAttribute; if (propertyAttr == null) { if (field.Name == name) { return(GclUtil.CreatExFieldInfo(field, ForType)); //return field; } } else { if (propertyAttr.Code == name) { return(GclUtil.CreatExFieldInfo(field, ForType)); //return field; } } } } if (ParentMapping != null) { return(ParentMapping.SearchExField(name)); } return(null); }