OrderBy/ThenBy applied in incorrect order with InMemoryAdapter #252

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

Comments

Projects
None yet
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.

@ghost ghost assigned markrendle Jan 23, 2013

mattwolin added a commit to mattwolin/Simple.Data that referenced this issue Feb 12, 2013

Update Simple.Data.InMemoryTest/InMemoryTests.cs
Adding a test related to Order By/Then By Issue #252:

markrendle#252

mattwolin added a commit to mattwolin/Simple.Data that referenced this issue Feb 12, 2013

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

markrendle added a commit that referenced this issue May 9, 2013

Merge pull request #260 from mattwolin/master
Fix OrderBy/Then By issue with In-Memory adapter. Issue #252

@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