I'm working on an abstract class where the implementing class needs to implement a list of T. The problem is that this doesn't work:
public class AbstractClass
{
public int Id { get; set; }
public int Name { get; set; }
public abstract List<T> Items { get; set; }
}
public class Container : AbstractClass
{
public List<Widgets> Items { get; set; }
}
I'm sure that there is an obvious answer that I'm missing, and I know that I can build an abstract base type to put in the list, but when I use my Linq command to build the list, the abstract type (ItemBase) doesn't play nicely with the .ToList() method. Is what I'm trying to do so unique?