var groupList1 = grantCard.GroupBy(x => new { x.ProductId }).Select(group => new { ProductId = group.Key, Quantity = group.Count() }).ToList();
c# GroupBy的使用

最新推荐文章于 2024-06-19 23:26:41 发布

var groupList1 = grantCard.GroupBy(x => new { x.ProductId }).Select(group => new { ProductId = group.Key, Quantity = group.Count() }).ToList();