class Base {}
abstract class A
{
abstract public List<Base> Items { get; set; }
}
class Derived : Base {}
class B : A
{
private List<Derived> items;
public override List<Derived> Items
{
get
{
return items;
}
set
{
items = value;
}
}
}
The compiler says that B.Items must be List of Base elements "to match overridden member" A.Items. How can i make that work?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…