<分区>
如何使下面显示的方法返回属性的名称
public class MyClass
{
private string _MyProperty = "TEST";
public string MyProperty
{
get { return _MyProperty; }
set { _MyProperty = value; }
}
public string GetName()
{
return _MyProperty; // <- should return "MyProperty";
}
我不想使用 return "MyProperty"所以还有其他选择吗?