Problem with default value with empty result

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Problem with default value with empty result

Post by dilbert » Thu 21 Jun 2012 16:16

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 ...

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Problem with default value with empty result

Post by MariiaI » Fri 22 Jun 2012 09:24

We have reproduced this issue. We will investigate it and notify you about the results as soon as possible.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Problem with default value with empty result

Post by MariiaI » Mon 02 Jul 2012 10:01

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.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Problem with default value with empty result

Post by MariiaI » Thu 19 Jul 2012 06:53

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

Post Reply