using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace ZicMoove.Helpers { public static class PropertySupport { public static string ExtractPropertyName(Expression> propertyExpression) { if (propertyExpression == null) { throw new ArgumentNullException("propertyExpression"); } var memberExpression = propertyExpression.Body as MemberExpression; if (memberExpression == null) { throw new ArgumentException("Invalide Expression", "propertyExpression"); } return memberExpression.Member.Name; } } }