Introduction

Grouping objects into collections and performing actions on this collection are one of the most fundamental programming tasks. Given its importance, it’s helpful to recall the ICollection class and some of its capabilities.

The ICollection class is a base interface for all other classes in the System.Collections namespace. The generic equivalent is the System.Collections.Generic.ICollection<T> interface. The ICollection interface itself extends the IEnumerable interface. This basic schematic is shown in the figure below:

Get hands-on with 1400+ tech skills courses.