Monday, June 20, 2016

IEnumerable

IEnumerable:

  • IEnumerable exists in the System.Collections namespace.
  • IEnumerable is suitable for querying data from in-memory collections like List, Array and so on.
  •       While querying data from the database, IEnumerable executes “Select Query” on the server-side, loads data in-memory on the client-side and filters the data.
  •     IEnumerable is beneficial for Linq to Object and Linq to XML Queries.

  • IEnumerable doesn’t support Add or Remove items from the List.
  • Using IEnumerable we can find out the no of elements in the collection after iterating the collection.
  • IEnumerable supports deferred execution.
  • IEnumerable supports further filtering.  
  •       IEnumerable can move forward only over a collection. It can’t move backward and between the items.
  •       IEnumerable is best to query data from in-memory collections like List, Array etc,

No comments:

Post a Comment