how to read list property of Generic Class using Reflection in C# code example
Example 1: 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...
}
Example 2: c# list of properties from list of objects
List<string> firstNames = people.Select(person => person.FirstName).ToList();