2
J'ai une grande table d'articles et je dois les organiser par catégorie, puis par année, puis par mois.Linq Nested Grouping
L'élément possède des propriétés CategoryID et Dated.
Je suis arrivé jusqu'ici:
Dim Items = From Item In DB.Items _
Group By CategoryID = Item.CategoryID _
Into Categories = Group _
Order By CategoryID
Mais là où je mets le:
Group By Year = Year(Item.Dated)
et
Group By Month = Month(Item.Dated)
Le résultat final devrait être quelque chose comme ceci:
For Each Category in Categories
For Each Year in Category.Years
For Each Month in Year.Months
For Each Item in Month.Items
Next
Next
Next
Next
Merci