I have class where the relevant part looks like
class C {
void Method(SomeClass obj) {
list.Add(obj);
}
List> l
Personally, I would do this where possible; move the generic parameter from the method, to the class.
class C {
void Method(SomeClass obj) {
list.Add(obj);
}
List> list = new List>();
}
If your generic list is a member, it stands to reason that the class should be constructed with this in mind. It is hard for us to suggest the best pattern without more usage context for the class.