Ieri sera ho sognato che era impossibile seguire le seguenti affermazioni. Ma nello stesso sogno, qualcuno della SO mi ha detto diversamente. Quindi vorrei sapere se è possibile convertire System.ArrayinList
Array ints = Array.CreateInstance(typeof(int), 5);
ints.SetValue(10, 0);
ints.SetValue(20, 1);
ints.SetValue(10, 2);
ints.SetValue(34, 3);
ints.SetValue(113, 4);
per
List<int> lst = ints.OfType<int>(); // not working
Arrayquello che è in realtà, an int[], quindi puoi usare ToList:((int[])ints).ToList();