Списък на обекти в c#

Примерен код

5
0

как да се създаде списък на c#

C# By Magnificent Mamba on Dec 23 2019
IList<int> newList = new List<int>(){1,2,3,4};
3
0

към списъка на c#

var arr = new int[] {1, 2, 3};
List<int> list = arr.ToList();
3
0

списък на имотите c# от списъка с обекти

List<string> firstNames = people.Select(person => person.FirstName).ToList();
0
0

c# получите списък на тип обект общия списък

Type type = pi.PropertyType;
if(type.IsGenericType && type.GetGenericTypeDefinition()
        == typeof(List<>))
{
    Type itemType = type.GetGenericArguments()[0]; // use this...
}

Подобни страници

Подобни страници с примери