private PropertyInfo GetInstanceComplexPropertyInstance(object obj, string propName, out object instance) { instance = null; PropertyInfo info = null; foreach (String part in propName.Split('.')) { if (obj == null) { return(null); } instance = obj; Type type = obj.GetType(); info = RuleAwareEntityPropertyInfo.GetInstancePropertyInfo(type, part); if (info == null) { return(null); } obj = info.GetValue(obj, null); } return(info); }
private bool TryGetInstanceProperty(string property, out PropertyInfo info, out object instance) { if (property.Contains(".")) { info = GetInstanceComplexPropertyInstance(this, property, out instance); } else { info = RuleAwareEntityPropertyInfo.GetInstancePropertyInfo(GetType(), property); instance = this; } if (info == null) { return(false); } return(true); }