Aloha
I have a method with (pseudo) signature:
public static T Parse<T>(string datadictionary) where T : List<U>
This doesn't build. How can I restrict the in the method to accept only generic List<> objects (which should of cource not contain T's but something else :)
I need to restrict the type of T because I need to call a method on it in this code. The type passed in is a custom collection (based on List).
public class MyCollection<T> : List<T> where T: MyClass, new()
{
public void Foo();
}
public static T Parse<T>(string datadictionary) where T : MyCollection<U>
{
T.Foo();
}
-Edoode