Answers for "how to get properties from list of generic object in c#"

C#
3

c# list of properties from list of objects

List<string> firstNames = people.Select(person => person.FirstName).ToList();
Posted by: Guest on May-11-2020
0

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...
}
Posted by: Guest on October-15-2020

Code answers related to "how to get properties from list of generic object in c#"

C# Answers by Framework

Browse Popular Code Answers by Language