I'm appalled I haven't found anything on the internet about this problem, but probably I'm looking for the wrong words. Here is what I need to do.
Suppose I have a generic type: List<string> works for the sake of simplicity. How do I get the parameter type (in this case typeof(string))?
Keep in mind that I need to do this from outside the generic class (not inside a class method, which is what I've seen in other SO questions). The bottom line is that I have an instance of a generic type, I need to know both its type AND its parameter type (in the example above, I would like to get both typeof(List) AND typeof(string), not anything like typeof(List<string>)). Of course, this must be done at runtime.
Thanks to everyone who will reply.