I've got quite a strange thing happening on an ASP.NET 4.0 web application using EF 4.0 as its database backend. Essentially, I've got a table that stores users' password reset requests (containing a reset key of type byte[], an expiry of type DateTime, and a foreign key to a User containing a string Email and string Name). Some users do not have an email address set, so for a PasswordRequest request, request.Email is null.

Nicely done! The where condition is a bit loose. So I guess putting in all three possible values for e make sense.
–
Hassan GulzarNov 11 '11 at 7:44

I had a problem where my database contained a INT column that allowed nulls, so some of the other solutions wouldn't work for me (most solutions deal with strings) - your last bit of code saved my life! thanks! Here's what i ended up using: (w.AccountID ?? _AccountID) == _AccountID
–
LosbearNov 16 '12 at 17:07