This question is locked. New answers and comments are not allowed.
Using the Northwind sample db the following query:
from c
in
db.Customers
from o
in
c.Orders.DefaultIfEmpty()
where c.CustomerID ==
"FISSA"
select
new
{ Customer = c, Order = o };
generates the following sql:
SELECT
a.[CustomerID]
AS
COL1, b.[OrderID]
AS
COL2
FROM
[Customers] a
JOIN
[Orders]
AS
b
ON
(a.[CustomerID] = b.[CustomerID])
WHERE
a.[CustomerID] =
'FISSA'
ORDER
BY
COL1
That join should be a left outer join, not an inner join. This query should return exactly 1 row with Customer={customer record with Id=FISSA} and Order=null. Instead it returns 0 rows. No exception or warning, just plain wrong results!
Possible workaround is to substitute the navigation property with an explicit left join:
from c
in
db.Customers
join o
in
db.Orders on c equals o.Customer into og
from o
in
og.DefaultIfEmpty()
where c.CustomerID ==
"FISSA"
select
new
{ Customer = c, Order = o };
Using OA 2013.3.1014