Page 1 of 1

Small bug with NULL value

Posted: Fri 12 Dec 2008 03:19
by dqminh
Hi,

The query with NULL value has small bug: when compare with NULL, we must pass null keyword, not a parameter which has null value. See example:

Code: Select all

PartDataContext db = new PartDataContext();
string parent = null;

// it not works
var r1 = db.Dealers.Where(p => p.ParentCode == parent); // 0 result

// it works
var r2 = db.Dealers.Where(p => p.ParentCode == null); // has result

Posted: Fri 12 Dec 2008 12:15
by AndreyR
The first case is not supported yet.
We will investigate the possibility of implementing this, but no timeframe can be determined now.