---
title: "What is the difference between IEnumerable, ICollection and IList in C#?"  
description: "What is the difference between IEnumerable, ICollection and IList in C#?"  
author: "Zeynep Kiliç"  
published: 2026-11-12  
updated: 2026-11-12  
canonical: https://www.mindstick.com/forum/163000/what-is-the-difference-between-ienumerable-icollection-and-ilist-in-c  
category: "C# and .NET"  
tags: ["c#", "IEnumerable", "IList", "collections", ".net"]  
reading_time: 1 minute  

---

# What is the difference between IEnumerable, ICollection and IList in C#?

I see all three used as method parameters and return types in our codebase. Which one should I pick, and does the choice actually matter?

## Replies

### Reply by Alessandro Bianchi

Each interface adds capability on top of the one before it:

- **IEnumerable<T>** can only be looped over (foreach). Nothing else.
- **ICollection<T>** adds Count, Add, Remove, Contains and Clear.
- **IList<T>** adds access by index (list[0]), Insert and RemoveAt.

A good rule: accept the smallest interface you need, and return the most useful one you are happy to promise. If a method only loops, take IEnumerable<T>. If you return a finished list that callers should not change, return IReadOnlyList<T>.

One trap: an IEnumerable produced by LINQ is usually deferred, so the query can run again on every loop. If you will enumerate the result twice, call ToList() once and keep the list.


---

Original Source: https://www.mindstick.com/forum/163000/what-is-the-difference-between-ienumerable-icollection-and-ilist-in-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
