我用这个代码
var items2 = from item in context.Images
where item.Reported != true
select item;
但为什么“报告”列中不返回空值?
最佳答案
true
或 false
与 null
的值不同。如果您需要返回两者,那么您需要将查询更改为:
var items2 = from item in context.Images
where item.Reported != true || item.Reported == null
select item;
关于c# - 为什么在 linq 中应用 != 时不返回空值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16572570/