okay have a this list:
object[] test;
test[0]=null;
....
test[8700]=null;
test[8701]= object[]
....
test[9431]= object[]
where object[] is another list with either the value true/false/null
i need to convert this array into a list/dictinary containing only values without null:
Dictionary<int, object> dic = new Dictionary<int,object>;
or
list<Sector> sectors= new list<Sector>()
where sector looks like this
Sector{(int)id,(List<Product>)products}
Product{(int)id}
what will be the best/smartest way to do this?
Thanks in advance
Use the
Select()overload that supplies the index of the object:or to get the dictionary: