Skip to content

Commit 4e5d5f9

Browse files
committed
deal with case where 0 is sent for size or top
1 parent c9d404a commit 4e5d5f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

NorthwindCRUD/Services/PagingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public PagedResultDto<TDto> FetchPagedData<TEntity, TDto>(
7474
Items = pagedDataDtos,
7575
TotalRecordsCount = totalRecords,
7676
PageSize = currentSize,
77-
PageNumber = isPageSize ? ((skipRecordsAmount / currentSize) + 1) : ((skipRecordsAmount / currentSize) + 1),
77+
PageNumber = currentSize != 0 ? (isPageIndexAndSize ? (skipRecordsAmount / currentSize) : (skipRecordsAmount / currentSize) + 1) : default,
7878
TotalPages = totalPages,
7979
};
8080
}

0 commit comments

Comments
 (0)