有一个 T-SQL 查询:
select [ProductNumber] ,max([ProductRevNumber])
from Products
group by [ProductNumber]
尝试的 LINQ 查询:
ProductsDBContext.Products.GroupBy(x => x.ProductRevNumber)
.Select(group => ProductNumber,
ProductRevNumber = group.Max(x => x.ProductRevNumber));
lambda 查询不起作用。