Page 1 of 1

Problem with default value with empty result

Posted: Thu 21 Jun 2012 16:16
by dilbert
And another bug in LinqConnect 4.x (tested with dotConnect for Mysql 7.0.17):

Code: Select all

(from u in DB.Users where u.Id == -1 select u.Id).FirstOrDefault();
There is the following exception if a result set is empty.
(With LinqConnect 3.x the result was correctly set to default value 0.)

Message: Object reference not set to an instance of an object.
Stacktrace:
at Devart.Data.Linq.Engine.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
at ...

Re: Problem with default value with empty result

Posted: Fri 22 Jun 2012 09:24
by MariiaI
We have reproduced this issue. We will investigate it and notify you about the results as soon as possible.

Re: Problem with default value with empty result

Posted: Mon 02 Jul 2012 10:01
by MariiaI
The bug, related to the problem with the FirstOrDefault() function when result set is empty, has been fixed. It will be available in the next build of LinqConnect, which we plan to release next week.

Re: Problem with default value with empty result

Posted: Thu 19 Jul 2012 06:53
by MariiaI
New build of LinqConnect 4.0.45 is available for download now!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=24531