Hello all,
I have the following example code giving me a headache:
IQueryable q1 = context.ImportDefinitions
.Where(x => x.Code.ToUpper() == table.ToUpper()
&& Utilities.DateUtility.GetToday() >= x.BeginDate
&& Utilities.DateUtility.GetToday() <= x.EndDate);
var x1 = q1.Single(); // NO exception thrown, but x1 == null
var x2 = q1.ToList();
var x3 = x2.Single(); // Exception is thrown here!
q1.Single() should throw an exception an NEVER return NULL, like it does in the above example. When I do q1.ToList() and then call .Single() on it, the exception is thrown like it should.
Because in the latter case, the exception is thrown and in the first case it isn't, I suspect it's a problem with DevArt.
Can anyone confirm this and/or does anyone have a solution?
Kind regards,
Edwin.