This code shows a property that calls out to a method to get that property's name:
public string Foo { get { return MyName(); } }
string MyName([System.Runtime.CompilerServices.CallerMemberName]
string propertyName = null)
{
return propertyName;
}
Is there a better way?