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 AbstractC
You need the declaration on the class as well, to know what type T is:
public abstract class AbstractClass
{
public int Id { get; set; }
public int Name { get; set; }
public abstract List Items { get; set; }
}
public class Container : AbstractClass
{
public override List Items { get; set; }
}
You can also restrict what T can be, like say it must implement IWidgets:
public class AbstractClass where T : IWidgets