I have the following list (simplified):
Name | Brand
Shirt0 | Adidas
Shirt1 | Nike
Shirt2 | Adidas
Shirt3 | Adidas
Shirt4 | Erima
Shirt5 | Nike
I want to order it by Brand, and display (a maximum of) two of a brand in sequence.
Therefore I would not display all 3 Adidas products first, but only two!
Result:
Shirt0 | Adidas
Shirt2 | Adidas
Shirt1 | Nike
Shirt5 | Nike
Shirt4 | Erima
Shirt3 | Adidas
So it takes two products from every brand, and starts over when no more available.
Any ideas how to achieve this with LINQ?