Is it possible to inherit a List of base objects as List of derived objects? Don't know how to explain it better. Hope this example makes it clear:
public abstract class MyBase
{ }
public class MyConcrete: MyBase
{ }
public abstract class MyBases: IList<MyBase>
{
internal abstract List<MyBase> Items { get; set; }
public MyBase this[int index] { get => ((IList<MyBase>)Items)[index]; set => ((IList<MyBase>)Items)[index] = value; }
// other implementations of IList...
}
public class MyConcretes: MyBases
{
//Possible:
internal override List<MyBase> Items { get; set; }
// Needed
internal override List<MyConcrete> Items { get; set; }
}