Is there an easy way of converting remaining in the following code to a 1-D array.
var groups = data.OrderBy(d => d.Time).GroupBy(d => d.Period);
var first = groups.First().ToArray();
var remaining = groups.Skip(1).??
var remaining = groups.Skip(1).SelectMany(g=>g).ToArray();
Use SelectMany to "flatten" a collection of collections:
var remaining = groups.Skip(1).SelectMany(d => d).ToArray();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With