I have class where the relevant part looks like
class C {
void Method(SomeClass obj) {
list.Add(obj);
}
List> l
I don't think you can do this in C#... you would have to add the type parameter to the class:
class C {
void Method(SomeClass obj) {
list.Add(obj);
}
List> list = new List>();
}
The other option would be to use an interface:
class C {
void Method(T obj)
where T : ISomeClass {
list.Add(obj);
}
List list = new List();
}