Summary
In this chapter, we learned about generic collections in .NET, the data structures they model, and the interfaces they implement. We looked at the most important collections in the System.Collections.Generic
namespaces, List<T>
, Stack<T>
, Queue<T>
, LinkedList<T>
, Dictionary<TKey, TValue>
, and HashSet<T>
, and learned how to use them and perform operations such as adding, removing, or searching elements. In the last part of this chapter, we also looked at the System.Collection.Concurrent
namespace and the thread-safe collections it provides. Then, we learned about the particularities of each collection and the typical scenarios where they are suitable to be used.
In the next chapter, we will explore some advanced topics such as delegates and events, tuples, regular expressions, pattern matching, and extension methods.