我有一个SQL查询。请有人帮我转换成LINQ。
select * from ProductOrder where OrderId != (Select OrderId from OrderEvents) and MemberId=2
我写这段代码。但是这不起作用。请帮我。
from order in db.ProductOrder
from cancel in db.OrderEvents
where order.MemberId == MemberId
where order.OrderId != cancel.OrderId
//orderby order.OrderId descending
select order
答案 0 :(得分:0)
ProductOrder.Where(x=>x.OrderId != OrderEvents.OrderId && x.MemberId ==2)