16. Building Custom Collections

image

CHAPTER 14 COVERED standard query operators, a set of extension methods on IEnumerable<T> that added a common set of methods to all collections. However, this did not make all collections the same. There is still a strong need for different collection types. Some collections are better suited to searching by key, whereas others are better suited to index retrieval. Similarly, some collections follow a queue behavior of first in, first out, whereas others are more like a stack, as in last in, last out. The .NET Framework contains a plethora of different collections suited for the vast array of scenarios in which ...

Get Essential C# 4.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.