I have class like the following
public class Relation<T1, T2> where T1: Entity where T2: Entity
{
}
I want to make class derived from a list/collection which is of the type Relation
public class RelationList<T>: List<Relation>>
{
}
I have tried in SO but couldn't get things right. Even right pointer to SO will also help
Because your
Relationclass is generic you have to specify generic types when you derive fromRelation.Either as
or as
If you want
RelationListto be able to keepRelation<T1, T2>no matter howT1andT2is specified you should use additional interface: