Possible Duplicate:
C# generic list <T> how to get the type of T?
Lets say I have a List<Stock> given typeof(List<Stock>) how do I determine what the type is for the generic list? IE: In this case Stock?
Looking at the Type information I can see the AssemblyQualifiedName provides this to some degree
System.Collections.Generic.List`1[[FullQualifiedName.Stock,
TestApp, Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=null]], mscorlib,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
but I’m wondering if I can actually return the Type of the generic Type for the list?
Try this:
In this case
innerType == typeof(Stock)