OrderBy with Skip and Take

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
brucecallen
Posts: 6
Joined: Tue 17 Feb 2015 20:31

OrderBy with Skip and Take

Post by brucecallen » Tue 17 Feb 2015 20:49

I am using the most recent version of dotConnect for Salesforce 2.4.573.
and EntityFramework 6.1.1

When I issue the following query the orderby is omitted from the SQL command.

Code: Select all

IQueryable<Account> accounts = _context.Accounts.Where(a => a.Type == "SomeType")
accounts = accounts.OrderBy("Name", "asc", true).Skip(50).Take(25);
List<Account> testList = accounts.ToList();
I am setting an interceptor in web.config:

Code: Select all

<interceptor type="System.Data.Entity.Infrastructure.Interception.DatabaseLogger, EntityFramework">
The resulting SQL command omits the ORDER BY
SELECT Extent1.Id AS Id, Extent1.Name as Name... FROM Account AS Extent1 WHERE 'SomeType' = Extent1.Type LIMIT 25 OFFSET 50
If I omit the Skip() then the ORDER By is included.

The same code works correctly with SQL Server generating SQL with
SELECT TOP (25) [Extent1].[Id] AS [Id], [Extent1].[Name] AS [Name]...
WHERE [Extent1].[row_number] > 50
ORDER BY [Extent1].[Name] ASC
The use of skip and take are incredibly important for server side pagination.

I see that something like this has been reported and fixed in the past:
http://forums.devart.com/viewtopic.php? ... kip#p46524

Any help with this is greatly appreciated.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: OrderBy with Skip and Take

Post by Shalex » Thu 19 Feb 2015 11:29

Thank you for your report. We have reproduced the issue. We will investigate it and notify you about the result.

Post Reply