Comments (6)
Sure, it's possible. Just curious: in what situations do you need an empty list?
from mvcpaging.
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.
from mvcpaging.
Alright, clear
from mvcpaging.
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:
var emptyList = new PagedList<SomeType>(null, 0, 1);
from mvcpaging.
The idea is not to create a mutable pagedlist, rather an immutable one
which indicates no results.
On Sunday, October 5, 2014, Martijn Boland [email protected] wrote:
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:var emptyList = new PagedList(null, 0, 1);
—
Reply to this email directly or view it on GitHub
#44 (comment)
.
Ciao,
Geoffrey
Geoffrey Braaf | +31655793290
Freelance .NET Software Architect & Passionate Developer |
http://wis3guy.net
Findsi: find-as-i | http://www.findsi.com
from mvcpaging.
Thanks for this tip wis3guy. It was indeed helpful.
from mvcpaging.
Related Issues (20)
- MaxNrOfPages behaves oddly at small page counts HOT 2
- Page one shows what should be on page 2 and so on. HOT 4
- MVC 6 and DotNet Core? HOT 6
- Not compatible with MVC 3 HOT 2
- Update 2.1.2 -> 2.1.4 broke pager HOT 1
- Please add an option to hide last page HOT 2
- Last page calculation is broken HOT 1
- Weird behaviour when the list have just part of data HOT 6
- mvcpaging conflicts with footable.js HOT 1
- mvcpaging dateformat change in url
- Last page not showing if same as max number of pages HOT 2
- Are pretty URLs possible? HOT 1
- add wrapper for PagerOptions HOT 1
- There is a bug for PagedList HOT 1
- Ajax reload pages alternative pagination HOT 1
- PageRouteValueKey not working HOT 4
- Custom template with DisplayTemplate and full path not working HOT 1
- Add Microsoft.AspNet.Mvc as NuGet external package dependency HOT 3
- All page links pass parameters in url... HOT 3
- Add options to hide first/last 2 pages + spacer. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mvcpaging.