Missing query operator support in Devart.Data.Linq

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 2
Joined: Thu 23 Jul 2009 20:28

Missing query operator support in Devart.Data.Linq

Post by 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: 725
Joined: Thu 28 Oct 2004 14:06

Post by 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

Post Reply