Is there a better way to get the Property name when passed in via a lambda expression? Here is what i currently have.
eg.
GetSortingInfo
This might be optimal
public static string GetPropertyName(Expression> expr) { var memberAccess = expr.Body as MemberExpression; var propertyInfo = memberAccess?.Member as PropertyInfo; var propertyName = propertyInfo?.Name; return propertyName; }