Skip to main content
 首页 » 编程设计

c#之system.linq groupby 多个元素

2024年02月13日15findumars

如何在多个元素上使用 groupby 进行选择? 类似

Docs.GroupBy(x => x.FieldA, x.FieldB ) 

谢谢。

请您参考如下方法:

使用匿名类型对象:

Docs.GroupBy(x => new {x.FieldA, x.FieldB} )