public static object GetValue(this MemberExpression member) { if (member.Expression.NodeType == ExpressionType.Parameter) { return(GetProperty(member)); } var parentMember = member.GetNextLevelUpObject(); var parent = parentMember.parent; var fieldName = parentMember.memberName; return(parent.GetValue(fieldName)); }