1
我想查询类别和产品之间的Northwind数据库的关系,其中每个类别都有多个产品...聚集查询瓦特/ LINQ到实体
进出口寻找一个查询,将与返回的类别1它的产品数量最多。
这是据我已经得到了
var results = from c in entities.CategorySet
orderby c.Products.Count descending
select new {
CategoryName = c.CategoryName,
ProductCount = c.Products.Count
};
var result = results.Take(1).First();
是有没有更有效的方法?