I have a List<List>. I want to get a single List from that.
List<int> from List<List<SomeClass>()
For loop is an obvious solution but i want something more better and eligent from performance point of view.
List<List<Employee>> ValueLists;
List<int> Current= ValueLists.SelectMany(u=>u.Select(v=>v.EmployeeID));
Try this:
I’m not sure exactly what extra info you’re after. The edit you made to the question is almost complete code.
You should have written:
This could be written as this instead:
Maybe that gives more clarity.