Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginate: Exception Thrown with 0 Index for PageIndex #20

Open
DavidRogersDev opened this issue Feb 12, 2014 · 0 comments
Open

Paginate: Exception Thrown with 0 Index for PageIndex #20

DavidRogersDev opened this issue Feb 12, 2014 · 0 comments

Comments

@DavidRogersDev
Copy link

I think there may be a problem with the Paginated-related code.

I incorporated your repository (EntityRepository) into a project of mine. Whilst running a few scenarios, I found that if I made a call to the overload of Paginate, which takes PageIndex and PageSize as parameters, and passed in a PageIndex of 0 (e.g. Paginate(0, 2)) then an exception would be thrown in the extension method ToPaginatedList.

That would mean you would be passing -2 into the
Skip method. The actual text of the ArgumentException is

Count must have a non-negative value. Parameter name: count

Then I thought you possibly wanted to use an index of 1 for the first page instead of 0. But that does not seem to be the case as I got erroneous results testing that theory.

Let me know if you cannot reproduce the error.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant