In C# 4.0 I am doing the following:
public string PropertyA
{
get;
set
{
DoSomething("PropertyA");
}
}
public string PropertyB
{
get;
set
{
DoSomething("PropertyB");
}
}
..I have a lot of these properties and doing it manually will be a pain. Is there a way I could replace this with:
public string PropertyA
{
get;
set
{
DoSomething(GetNameOfProperty());
}
}
..maybe using reflection?