UseDatabaseNullSemantics still generating NULL checks

前端 未结 2 1330
失恋的感觉
失恋的感觉 2021-01-14 15:16

I have this on my context object (constructor):

this.Configuration.UseDatabaseNullSemantics = true;

But even with this set, this query:

2条回答
  •  Happy的楠姐
    2021-01-14 15:50

    The condition you see inside the generated SQL has nothing in common with UseDatabaseNullSemantics and is needed to handle correctly LEFT LOINs 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.

提交回复
热议问题