I googled and fined this link, but still not working Convert List<T> to object[]
I want to convert the list of int to object array. Why? because I want to add the list as object array in Combbox, it's the argument.
The problem is it adds just "one item" Object[] Array in Combobox, while "tempList" contains 4 items of type int.
I like to add the 4 items in the object[] (object array), now it adds as 1 item and just shows Object[] array in the debugger.
When I look in debugger and type :
customers - it shows object[1] and when I type
customers[0] it shows object[4], so in fact 4 items are added, but how can I get these values.???
List<int> tempList= new CustomersRepository().GetAll().Select(a => a.Numero).ToList();
object[] customers = new object[] { tempList.Cast<object>().ToArray() };
ComboBox.Items.AddRange(customers);