0

I would like to group a list like this:

a = { Country = "France", Value = 45, Order = 1 }
b = { Country = "France", Value = 55, Order = 2 }
c = { Country = "Italy", Value = 105, Order = 3 }
d = { Country = "France", Value = 10, Order = 4 }
e = { Country = "Germany", Value = 11, Order = 5 }
f = { Country = "Germany", Value = 852, Order = 6 }
g = { Country = "Italy", Value = 26, Order = 7 }

To get the following groups :

{ a, b }, { c }, { d }, { e, f }, { g }

So in other words grouping by Country but following the Order. I don't know how to do that with a Linq statement (and if it is possible) I think it is not Subgroups because I don't really see a "Master" grouping on top of all.

bAN
  • 13,375
  • 16
  • 60
  • 93

0 Answers0