I have a view model with a nullable int...
public ObjectViewModel (){
public int? Total
}
... and there are several rows in my DB where the total is null.
Despite that, this always returns false:
bool exists = repo.AllRows() // renamed this for clarity; returns IQueryable
.Any(r => r.Total == vm.Total); // I know r.Total and vm.Total
// are both null
But the following returns true (as expected):
bool exists = repo.All().Any(r => r.Total == null);
Any idea what I am doing wrong here?
All
beforeAny
? – Jonas ElfströmAll
? As far as I know it can't be called without one. – Jonas Elfström