The linq Last method throws a exception

The linq Last method throws a exception

Postby ashlar64 » Tue 09 Jun 2015 15:32

Hello,

This line of code works fine:
var v = context.Jobs.First();

This line of code throws a exception:
var v = context.Jobs.Last();

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

I assume this is a bug?
ashlar64
 
Posts: 75
Joined: Thu 04 May 2006 18:56

Re: The linq Last method throws a exception

Postby MariiaI » Wed 10 Jun 2015 10:09

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

This is an expected error due to the fact that it is not supported in LinqConnect, as well as in Microsoft LINQ to SQL.
A similar issues and solutions have been discussed here:
http://forums.devart.com/viewtopic.php?t=15796
http://stackoverflow.com/questions/1262905/net-linqs-last
http://stackoverflow.com/questions/7253529/last-and-lastordefault-not-supported
http://stackoverflow.com/questions/3476289/last-method-not-working-on-iqueryable-object

If you have any further questions regarding working with LinqConnect, feel free to contact us.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to LinqConnect (LINQ to SQL support)