mrahhal / MR.EntityFrameworkCore.KeysetPagination

Keyset/Seek/Cursor pagination for Entity Framework Core.
MIT License
236 stars 12 forks source link

Performing subtraction in a query breaks sorting #35

Closed atrauzzi closed 1 year ago

atrauzzi commented 1 year ago

We're using subtraction of dates or EF.Functions.DateDiffHour() in a query we're trying to keyset paginate.

Unfortunately, this is resulting in a LINQ error that the query can no longer be compiled.

Is there a limitation that would prevent sorting on computed columns?

mrahhal commented 1 year ago

Can you show the actual error with the stacktrace alongside the pagination code? It seems this is coming from EF itself so I'm wondering where KeysetPagination's involvement is here.

And to answer the question, no there's no limitation. There are already examples and tests showing pagination over computed columns. Unless by "computed columns" you mean something related to the DateDiffHour?

mrahhal commented 1 year ago

I'm closing this, please reopen with more details if you still have issues.