陳盈學
陳盈學

Reputation: 1

looking for a way to create Linq-to-SQL Master-Detail with where in Detail

I have a SQL:

select * 
from order
LEFT OUTER JOIN orderDetail
 where 
(select count(*) from orderDetail where orderDetail.id=order.id and orderDetail.productName='book')>0

how can it implement in LINQ

thanks

Upvotes: 0

Views: 185

Answers (1)

JK.
JK.

Reputation: 21826

Looks like your SQL is wrong to start with. This looks more correct:

select * 
from order
LEFT OUTER JOIN orderDetail
on (orderDetail.id=order.id and orderDetail.productName='book')

Upvotes: 1

Related Questions