Missing query operator support in Devart.Data.Linq

Missing query operator support in Devart.Data.Linq

Postby klay » Fri 11 Sep 2009 13:30


I'm a relatively new user of dotConnect for Oracle. When I try to construct the following Linq statement:

Code: Select all
var range =
            from p in context.PreprocessingDatas
            where p.DateTime != DateTime.MinValue
            orderby p.DateTime
            select p
         // setup default start and end dates for queries
         startDate = range.First().DateTime;
         endDate = range.Last().DateTime;

and I get the following error:

"The query operator 'Last' is not supported."

The same error occurs when I use 'LastOrDefault'. Are these operators really not supported? If not, in which contexts?
Posts: 2
Joined: Thu 23 Jul 2009 20:28

Postby Paul » Tue 15 Sep 2009 08:02

Yes. It is not supported in Linq To SQL.
Implementation of Linq To SQL by Microsoft does not support it too.
There is no simple way to translate this to SQL. Try to use Skip, Take instead
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Return to dotConnect for Oracle