Reputation: 883
How do I use group by in LINQ? I want to group by tow filed of table in C# by linq.
Upvotes: 0
Views: 1619
Reputation: 3821
var query =
from t in db.tableName
group t by new { t.column1, t.column2 } into g
select new { g.Key.column1, g.Key.column2 };
Upvotes: 1