实体框架在where子句中添加了额外条件 [英] Entity framework adds an extra condition on where clause
本文介绍了实体框架在where子句中添加了额外条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当执行以下表达式时,我已经确定:
I have identified that when the following expression is executed:
int aNum = 52;
var myArtifacts = mydbcontext.artifacts.Where(a => a.ParentID == aNum ).ToList();
在mysql上执行的查询是:
on mysql the query executed is:
SELECT
`Extent1`.`ID`,
`Extent1`.`ParentID`
FROM `artifacts` AS `Extent1`
WHERE ((`Extent1`.`ParentID` = 52) AND (52 IS NOT NULL));
任何人都可以解释一下为什么添加了最后一个额外条件吗?
Can anyone explain please why this last extra condition is added?
AND(52不为空)
AND (52 IS NOT NULL))
推荐答案
查看全文