Skip to content

OrderBy/ThenBy applied in incorrect order with InMemoryAdapter #252

Closed
cammerman opened this Issue Dec 27, 2012 · 0 comments

2 participants

@cammerman

Using the InMemoryAdapter for testing, a sequence of ordering directives appears to be applied in reverse of the expected order.

As an example, take the query expression below:

Db.UiBacklogSchedules.All()
.OrderBy(Db.Connection.UiBacklogSchedules.ScheduleDueDate)
.ThenBy(Db.Connection.UiBacklogSchedules.ActiveFlagSort)
.ThenBy(Db.Connection.UiBacklogSchedules.ScheduleId)

Running this against the database, this produces the expected ORDER BY clause:
ORDER BY ScheduleDueDate, ActiveFlagSort, Scheduled

However, when running against the InMemoryAdapter, the sorting is applied in exactly the reverse order: First by Scheduled, then ActiveFlagSort, then ScheduleDueDate.

@markrendle markrendle was assigned Jan 23, 2013
@mattwolin mattwolin added a commit to mattwolin/Simple.Data that referenced this issue Feb 12, 2013
@mattwolin mattwolin Update Simple.Data.InMemoryTest/InMemoryTests.cs
Adding a test related to Order By/Then By Issue #252:

markrendle#252
a7cd1d0
@mattwolin mattwolin added a commit to mattwolin/Simple.Data that referenced this issue Feb 12, 2013
@mattwolin mattwolin Update Simple.Data/QueryPolyfills/DictionaryQueryRunner.cs
Running order by clauses in reverse order to fix issue with Order By/Then by for in-memory adapter. #252:
markrendle#252
e85dedf
@markrendle markrendle closed this May 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.