据我所知,在C# 2.0中无法实现以下操作。
public class Father
{
public virtual Father SomePropertyName
{
get
{
return this;
}
}
}
public class Child : Father
{
public override Child SomePropertyName
{
get
{
return this;
}
}
}
我通过在派生类中将属性创建为 "new" 来解决了这个问题,但这当然不是多态的。
public new Child SomePropertyName
2.0有什么解决方案吗? 3.5中是否有任何解决此问题的功能?