There is a whole wealth of reflection examples out there that allow you to get either:
1. All properties in a class
2. A single property, provided you kn
acutully the right answer which is written by TKTS, and here I just want to convert his syntax to C#
public static string GetPropertyName<t>(Expression<Func<t>> PropertyExp)
{
return (PropertyExp.Body as MemberExpression).Member.Name;
}
and the usage of this code goes like the example as below:
string name = GetPropertyName(() => (new Tasks()).Title);
in addition : there is an exception could be happen that when the comes with all properties has null values, so anybody has to take this on his concentration when hes implementing his code
Thanks TKTS ..