-
Notifications
You must be signed in to change notification settings - Fork 144
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
Create an empty paged list #44
Comments
Sure, it's possible. Just curious: in what situations do you need an empty list? |
F.ex when i want to return an empty search result. Sometimes i can already determine that a search is not going to yield any results without firing a query. Or, f.ex. as a default values on my models. I always want my objects to be in a valid state, which means that in the default constructor i want to set my collection properties to an empty collection. |
Alright, clear |
Just looking at it, but I think it doesn't make any sense to create an empty constructor, because we'll have to assume some pagesize. Probably better to just use one of the existing constructors:
|
The idea is not to create a mutable pagedlist, rather an immutable one On Sunday, October 5, 2014, Martijn Boland [email protected] wrote:
Ciao, Geoffrey Braaf | +31655793290 |
Thanks for this tip wis3guy. It was indeed helpful. |
Sometimes it is useful to be able to create an empty instance of PagedList. As i did not want to change the library, i worked around this by doing this:
and then using
it would be cleaner if i could simply do:
The text was updated successfully, but these errors were encountered: