-2
我遇到了编码我的linq查询的问题。将SQL查询更改为linq查询 - 语法
这是我的SQL查询:
select
price, (cast(sum(Quantity) as decimal(7,2)))
from
OrderDetails
where
ItemID = 1000
group by
price
order by
price
这是我的LINQ查询:
var result = from od in db.OrderDetails
where od.ItemID == 1000
orderby od.Price
group by price
select od.price, (cast(sum(od.Quantity) as decimal(7, 2)));
这LINQ查询似乎是不正确的。什么是正确的语法?
它不工作。 – coco
它的工作原理。谢谢!!! – coco