Click here to Skip to main content
15,885,891 members
Articles / Programming Languages / C#

How to get property name using Expression

Rate me:
Please Sign up or sign in to vote.
4.90/5 (7 votes)
16 Dec 2011CPOL 32K   5  
Nice, I do like the expression trees. :)Unfortunately, I can't remember the reference I used to make this one, but I find the property name in a slightly different way:public static string PropertyName(Expression> expression){ var body = expression.Body as...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
16 Dec 2011ARanadhir 1 alternative  
How to get property name using Expression

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions