I know I could have an attribute but that\'s more work than I want to go to... and not general enough.
I want to do something like
class Whotsit
{
No, there's nothing to do this. The expression whotsit.TestProp will evaluate the property. What you want is the mythical "infoof" operator:
// I wish...
MemberInfo member = infoof(whotsit.TestProp);
As it is, you can only use reflection to get the property by name - not from code. (Or get all the properties, of course. It still doesn't help you with your sample though.)
One alternative is to use an expression tree:
Expression> = () => whotsit.TestProp;
then examine the expression tree to get the property.
If none of this helps, perhaps you could tell us more about why you want this functionality?