在listProducts
我有一个名为“家庭”的字段。我想GroupBy
这个领域。
var products = from listProducts in repository.All()
where (listProducts.Code == "48654")
select listProducts;`
答案 0 :(得分:0)
试试这个,
var products = from listProducts in repository.All()
where listProducts.Code == "48654"
group listProducts by listProducts.family into grp
select grp;
有关详细信息,请访问LINQ Group By