Possible Duplicate:
How to use reflection to call generic Method?
how can i do the following?
class A {}
void DoSomething<T, U> where T : List<U> {}
object o = new List<A>();
DoSomething(o); // cannot be inferred from usage error
I don't know the exact type of A until runtime.
Just to clarify. I have no access to change the DoSomething method. I know the following call will work
DoSomething(o as List<A>);
but I don't know A until runtime. Although I do know that all As will have a common sub class.