我有一个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
ProductOrder.Where(x=>x.OrderId != OrderEvents.OrderId && x.MemberId ==2)