1

我正在尝试将作为 PagedResult 返回的数据转换为使用 skip 和 take 进行分页的 PagedData:

eg:
For page1 – skip: 0, take: 25
For Page2 – skip: 25, take:25
For Page3 – skip: 50, take:25
and so on...

我使用以下转换来计算跳过和采取:

skip --- Convert.ToInt32((Result.CurrentPage-1)*Result.ItemsPerPage),
take --- Convert.ToInt32(Result.ItemsPerPage));

但是,上述逻辑不适用于计算跳过。有人可以帮我纠正逻辑吗?

4

0 回答 0