❔ Aggregate Group By Functions on Items
```
var items = new [] {
new Item { Year = 2021, Quarter = "Q1", Collection = "Modern", Price = 10 },
new Item { Year = 2021, Quarter = "Q2", Collection = "Antique", Price = 20 },
new Item { Year = 2021, Quarter = "Q3", Collection = "Modern", Price = 30 },
new Item { Year = 2021, Quarter = "Q4", Collection = "Modern", Price = 40 },
new Item { Year = 2022, Quarter = "Q1", Collection = "Antique", Price = 50 },
new Item { Year = 2022, Quarter = "Q2", Collection = "Modern", Price = 60 },
...
}
var groupBys = new []{ x => x.Year, x => x.Quarter, x => x.Collection }
//How to do this part?
//Or is there a better way?
var result = groupBys.Aggregate(items, (accumulator, groupBy) => accumulator.GroupBy(groupBy))
2 Replies