select * from product as p order by
(select sum(o.num) from order_product as o where o.state>0 and p.id=o.pro_id) desc
这句我用LINQ 应该怎么写呢?
select * from product as p order by
(select sum(o.num) from order_product as o where o.state>0 and p.id=o.pro_id) desc
这句我用LINQ 应该怎么写呢?
product.OrderByDescending(p => order_product.Where(o => o.state > 0 && p.id == o.pro_id).Select(o => o.num)Sum())