Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# get list object type of generic list

Type type = pi.PropertyType;
if(type.IsGenericType && type.GetGenericTypeDefinition()
        == typeof(List<>))
{
    Type itemType = type.GetGenericArguments()[0]; // use this...
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #list #object #type #generic #list
ADD COMMENT
Topic
Name
9+3 =