VB.Net Linq to Sql – Group By

Continue our programming pills series in VB.net, in this case: how to perform a Group By in Linq to Sql.

Dim spirit = From s In db.Spirit
                 Where s.AlcoholContent >= 40
                 Group By n = s.Name, c = s.AlcoholContent
                 Into g = Group
                 Select New With {
                     .Name = n,
                     .AlcoholContent = c}

Leave a Comment

Your email address will not be published. Required fields are marked *