define generic list c# code example
Example 1: to list c#
var arr = new int[] {1, 2, 3};
List<int> list = arr.ToList();
Example 2: 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...
}