samba siva
IEnumerable Vs IQueryable?
By samba siva in C# on Jul 09 2014
  • satish kumar
    May, 2015 23

    Ienumerable fetches the entire data from the database.It fetches the record one by one.It can Read , but cannot modify and update the data.It is the forward only data,we cannot insert the items at the middle.IQueryable : IQueryable fetches the Record based on filter wise. IQueryable is faster than IEnumerable.

    • 1
  • Arunava Bhattacharjee
    Sep, 2014 1

    In addition to Munesh Sharma's answer:IEnumerable loads data in-memory and then apply filters to it one by one but IQueryable apply filters all at once and return the result.

    • 1
  • samba siva
    Jul, 2014 9

    http://www.codeproject.com/Articles/732425/IEnumerable-Vs-IQueryable

    • 1
  • Munesh Sharma
    Jul, 2014 23

    IEnumerable: IEnumerable is best suitable for working with in-memory collection (or local queries). IEnumerable doesn't move between items, it is forward only collection.IQueryable: IQueryable best suits for remote data source, like a database or web service (or remote queries). IQueryable is a very powerful feature that enables a variety of interesting deferred execution scenarios (like paging and composition based queries).So when you have to simply iterate through the in-memory collection, use IEnumerable, if you need to do any manipulation with the collection like Dataset and other data sources, use IQueryable

    • 0
  • Kuldeep Patel
    Jul, 2014 22

    In case of IEnumerable, Return LINQ result list and thne execute condition But in IQuerable, which execute condition at the end and return the list

    • 0
  • Pradeep Shet
    Jul, 2014 18

    In case of IEnumerable, based on LINQ result I get the list But in IQuerable, I can have composite where conditions which get executed at the end and return the List

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS