Giter VIP home page Giter VIP logo

Comments (6)

martijnboland avatar martijnboland commented on August 20, 2024

Sure, it's possible. Just curious: in what situations do you need an empty list?

from mvcpaging.

wis3guy avatar wis3guy commented on August 20, 2024

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.

martijnboland avatar martijnboland commented on August 20, 2024

Alright, clear

from mvcpaging.

martijnboland avatar martijnboland commented on August 20, 2024

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.

wis3guy avatar wis3guy commented on August 20, 2024

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.

meatgithub avatar meatgithub commented on August 20, 2024

Thanks for this tip wis3guy. It was indeed helpful.

from mvcpaging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.