C#, Generic Lists and Inheritance
- by Andy
I have a class called Foo that defines a list of objects of type A:
class Foo {
List<A> Items = new List<A>();
}
I have a class called Bar that can save and load lists of objects of type B:
class Bar {
void Save(List<B> ComplexItems);
List<B> Load();
}
B is a child of A. Foo, Bar, A and B are in a library…