What is difference between IList and IEnumerable
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
nallyaRank #8,588 · 219 reputationPosted Sep 13, 2012, 3:01 AM EDT
IList
IList exists in System.Collections Namespace.
IList is used to access an element in a specific position/index in a list.
Like IEnumerable, IList is also best to query data from in-memory collections like List, Array etc.
IList is useful when you want to Add or remove items from the list.
IList can find out the no of elements in the collection without iterating the collection.
IList supports deferred execution.
IList doesn't support further filtering.
IEnumerable
IEnumerable exists in System.Collections Namespace.
IEnumerable is a forward only collection, it can't move backward and between the items.
IEnumerable is best to query data from in-memory collections like List, Array etc.
IEnumerable doen'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.