以下 Linq 代码:
db.Where(t => t.ToLower().Equals(name.ToLower()))
生成以下 postgresql 查询:
SELECT "Extent1"."Name"
FROM "Custom" AS "Extent1"
WHERE lower("Extent1"."Name") = lower(@__linq__0) OR
lower("Extent1"."Name") IS NULL AND lower(@__linq__0) IS NULL
为什么查询包含“IS NULL”条件?
最佳答案
可能是因为你的名字字符串变量可以为空,与表的值相同。 不确定 postgress 中是否为 null == null
关于c# - 为什么linq to postgresql使用tolower出现 "IS Null",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39042324/