Collections
Lists, dictionaries, LINQ, enumerables
ICollection extends IEnumerable with an O(1) Count property plus Add, Remove, Clear, and Contains, so it's the right contract when callers genuinely need a size check or mutation without caring about indexed access. Reach for it…
IEnumerable is the minimal "forward-only, read-only, lazy" sequence contract that every LINQ pipeline and foreach loop is built on. Returning it from APIs hides the concrete collection, enables deferred execution so filters compose…
IList extends ICollection with an indexer plus Insert, RemoveAt, and IndexOf, exposing random access at index i. Use it when callers truly need positional reads or insert-at-position semantics (an order book, a price ladder);…
IQueryable looks like IEnumerable but builds an expression tree instead of executing immediately, letting providers like EF Core translate the whole composed pipeline into a single SQL statement. Returning it from repositories…
IReadOnlyCollection and IReadOnlyList expose Count (and indexed access in the latter) without surfacing Add, Remove, or Clear, so callers can read and iterate but can't mutate your internal state. List already implements both…