I spent several hours trying to find the answer to this question, I probably have problems with the correct wording of the question, which does not help. Essentially, I have an abstract class:
public abstract class GenericType<T>
{ ... }
And a bunch of classes that inherit from it:
public class AType: GenericType<A>
{ ... }
public class BType: GenericType<B>
{ ... }
...
Finally, I have another class that wants to contain a list of things that inherit from GenericType, regardless of the value of T, i.e. Atypes, BTypes, etc.
My first attempts were to use List<GenericType>and List<GenericType<Object>>, but niether gave me any joy.
Any tips on how I should do this? Many thanks!
source
share