Given this linq query
from c in context.Customers
from o in c.Orders
where c.City == "MyCity" || o.ShipTo == "MyCity"
select c
the query will not return any rows if the customer's city is "MyCity" but does not have any orders. This is because of the implied inner join between Customers and Orders. How do I select customers with a City of "MyCity" or order shipped to "MyCity
In this case I need an outer join between Customers and Orders. How do I express that in Linq? I think the approximate TSQL would be
select customers.*
from customers
left join orders on customers.id = orders.customerid
where customers.city = 'MyCity' or orders.ShipTo = 'MyCity'