mrahhal / MR.EntityFrameworkCore.KeysetPagination

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

Unable to get the Last page working #55

Closed saisworld closed 5 months ago

saisworld commented 8 months ago

Hi,

I'm trying to get the "Last page" logic working. But it keeps returning the same first page rows. I following of logic mentioned in the documentation to use "backward"

searchResultsQuery.KeysetPaginate(_keysetBuilderAction, KeysetPaginationDirection.Backward);

but it keeps returning the same first page results. My query uses multiple joins across multiple tables using EF Core lambda. As EF Core doesnt support DistinctBy so I'm using .GroupBy(z=>z.Id).Select(g=>g.First()) for getting the Distinct rows in my query, is this causing an issue finding the last page ?

mrahhal commented 8 months ago

Hi. A minimal repro would really help, as I won't be able to tell just from what you explained. Not sure how .GroupBy(z=>z.Id).Select(g=>g.First()) factors into this, would need to see the full code in a repro.

Would also help if you try to run the sample in this repo and double check there. If the sample works that means something's wrong with either how you're building this query or maybe there's an edge case in what you're using.

mrahhal commented 5 months ago

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