Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 LINQ 中使用 group by?我想通过 linq 对 C# 中的表的两个字段进行分组。
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 };