I have this on my context object (constructor):
this.Configuration.UseDatabaseNullSemantics = true;
But even with this set, this query:
The condition you see inside the generated SQL has nothing in common with UseDatabaseNullSemantics
and is needed to handle correctly LEFT LOIN
s with nullable keys.
I think the problem you are experiencing is caused by a logical error in your query. IMO, the join condition
on o.linkedorderid equals o2.linkedorderid
should be
on o.linkedorderid equals o2.orderid
because normally the FK relates (joins) to the PK.