-3

我有一个 sql 查询。请有人帮我把它转换成 LINQ。

select * from ProductOrder where OrderId != (Select OrderId from OrderEvents) and MemberId=2

我写了这段代码。但 tis 不起作用。请帮我。

                              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
4

1 回答 1

0
ProductOrder.Where(x=>x.OrderId != OrderEvents.OrderId && x.MemberId ==2)
于 2014-04-18T13:14:36.500 回答