dncuug / X.PagedList

Library for easily paging through any IEnumerable/IQueryable in ASP.NET
https://nuget.org/packages/X.PagedList
MIT License
886 stars 213 forks source link

X.PagedList: PagedListExtensions: Fix logic in ToPagedList() #267

Closed adschmu closed 2 months ago

adschmu commented 2 months ago

The command flow in ToPagedList with totalSetCount appears odd:

As a consequence, it appears more appropriate to use the logic from X.PagedList.EF here as well (only in the sync version), which addresses all the mentioned issues.

Fixes: #266

adschmu commented 2 months ago

Found a broken test with this change and added the fix here as well.