MemberListView icon indicating copy to clipboard operation
MemberListView copied to clipboard

Paging uses wrong pageindex

Open niekvanderreest opened this issue 1 year ago • 0 comments

Hi,

The MemberExtendedService has a bug in the PerformExamineSearch function, this causes the first page to load when you click "next" or "2" in the pager, and makes the last page inaccessible.

The problem is following code, it already has a pageindex and substracts 1 from is, causing index:0 to be -1 and index 1 to be 0, and so on. I made my own implementation of the servcie and registered it, to confirm that removing the "-1" fixes this problem

if (pageSize > 0)
{
    int skipCount = (pageIndex > 0 && pageSize > 0) ? Convert.ToInt32((pageIndex -1) * pageSize) : 0;
    if (totalRecords < skipCount)
    {
        skipCount = (int)totalRecords / pageSize;
    }

    return results.Skip(skipCount).Take(pageSize);
} 

niekvanderreest avatar Feb 10 '24 11:02 niekvanderreest