Reputation: 10482
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).??
Upvotes: 3
Views: 2166
Reputation: 152556
Use SelectMany
to "flatten" a collection of collections:
var remaining = groups.Skip(1).SelectMany(d => d).ToArray();
Upvotes: 2