score:2

Accepted answer

You put the code inside publicstaticvoid Main(string[] args), meaning you don't have a Program instance to access the Foo instance member. It has nothing to do with expressions, GetMemberName will work as you wrote it regardless.


Related Query

More Query from same tag