Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. What's the difference between IList, IEnumerable, and IQueryable?

What's the difference between IList, IEnumerable, and IQueryable?

Scheduled Pinned Locked Moved The Lounge
pythonvisual-studiolinqcomfunctional
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #1

    I was asked that yesterday and didn't really know. It's always interesting to discover where my knowledge gaps are. Great article[^] on it right here on CP! Marc

    Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

    P F R 3 Replies Last reply
    0
    • M Marc Clifton

      I was asked that yesterday and didn't really know. It's always interesting to discover where my knowledge gaps are. Great article[^] on it right here on CP! Marc

      Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      I deal pretty heavily with these interfaces internally - most of my cache collections, for instance, return IEnumerable of the appropriate type.

      This space for rent

      1 Reply Last reply
      0
      • M Marc Clifton

        I was asked that yesterday and didn't really know. It's always interesting to discover where my knowledge gaps are. Great article[^] on it right here on CP! Marc

        Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

        F Offline
        F Offline
        F ES Sitecore
        wrote on last edited by
        #3

        I didn't think it was very good actually, it didn't show a great understanding of those interfaces and contained a fair amount of incorrect information and bad advice (eg using IEnumerable is bad for memory use as it brings back all records is the exact opposite of the truth). The author was making assumptions about the interfaces and their uses from SQL Profile traces from Entity Framework

        D M 2 Replies Last reply
        0
        • F F ES Sitecore

          I didn't think it was very good actually, it didn't show a great understanding of those interfaces and contained a fair amount of incorrect information and bad advice (eg using IEnumerable is bad for memory use as it brings back all records is the exact opposite of the truth). The author was making assumptions about the interfaces and their uses from SQL Profile traces from Entity Framework

          D Offline
          D Offline
          Dan Neely
          wrote on last edited by
          #4

          He lost a big chunk of upfront credibility in suggesting the use of the .net 1.x non-generic ArrayList and HashTable in some circumstances. Both types should have been moved to the System.Legacy.Cluster.Elephant.Do.Not.Ever.Use namespace eleven years ago when generics were added.

          Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

          1 Reply Last reply
          0
          • F F ES Sitecore

            I didn't think it was very good actually, it didn't show a great understanding of those interfaces and contained a fair amount of incorrect information and bad advice (eg using IEnumerable is bad for memory use as it brings back all records is the exact opposite of the truth). The author was making assumptions about the interfaces and their uses from SQL Profile traces from Entity Framework

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #5

            Ah. I briefly perused the messages, people seemed to have really liked the article, so I didn't see anything from the comments that indicated issues, but thanks for pointing that out. Marc

            Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

            N 1 Reply Last reply
            0
            • M Marc Clifton

              Ah. I briefly perused the messages, people seemed to have really liked the article, so I didn't see anything from the comments that indicated issues, but thanks for pointing that out. Marc

              Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

              N Offline
              N Offline
              Nish Nishant
              wrote on last edited by
              #6

              You might want to edit your original comment and replace the word "great" with "okay" :-)

              Regards, Nish


              Website: www.voidnish.com Blog: voidnish.wordpress.com

              1 Reply Last reply
              0
              • M Marc Clifton

                I was asked that yesterday and didn't really know. It's always interesting to discover where my knowledge gaps are. Great article[^] on it right here on CP! Marc

                Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

                R Offline
                R Offline
                Rob Grainger
                wrote on last edited by
                #7

                TLDR version: IEnumerable - supported by any sensible collection. Allows forward-only iteration. IList - provides further members - allows random access, and supports mutation operations. IQueryable - variant of IEnumerable designed to support deferred execution in LINQ. (Edit - just actually read the TLDR, and I must say I was more accurate too).

                "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups