The .NET Framework provides a number of interfaces, such as IEnumerable
and ICollection
, which the designer of a collection must implement to provide full collection semantics. For example, ICollection
allows your collection to be enumerated in a foreach
loop. You’ll see how these work in a little bit, when we explain the C# collection types. First, though, we’re going to show you how to make your own collections, so you can understand how they work.