Skip to content

Commit

Permalink
Merge pull request #52 from marcominerva/develop
Browse files Browse the repository at this point in the history
Change default value
  • Loading branch information
marcominerva committed Feb 20, 2024
2 parents 1dfef3f + 4d5638b commit aab3ed2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OperationResults/PaginatedListResult{ofT}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public PaginatedListResult()
{
}

public PaginatedListResult(IEnumerable<T>? items, int totalCount, int pageIndex, int pageSize = 0)
public PaginatedListResult(IEnumerable<T>? items, int totalCount, int pageIndex, int pageSize)
{
Items = items;
TotalCount = totalCount;
PageIndex = pageIndex;
PageSize = pageSize > 0 ? pageSize : items?.Count() ?? 0;
HasNextPage = totalCount > (pageIndex * PageSize) + (items?.Count() ?? 0);
PageSize = pageSize;
HasNextPage = totalCount > (pageIndex * pageSize) + (items?.Count() ?? 0);
}

public PaginatedListResult(IEnumerable<T>? items, bool hasNextPage = false) : this(items, items?.Count() ?? 0, hasNextPage)
Expand Down

0 comments on commit aab3ed2

Please sign in to comment.