
Explore the common collections in system.collections.generic, such as list of t, linked list of t, dictionary, and sorted list, and learn about attributes and the enumerable interface.
Meet the author who began coding in 1998 with JavaScript, transitioned to C# and the .NET framework, and now writes desktop and web applications for an oil and gas company.
Design a custom display order attribute by creating a class that inherits from Attribute, uses AttributeUsage to target properties, and defines a constructor with a position parameter.
Discover how reflection uses display order attributes to enumerate object properties and serialize them into a csv string, with position-driven values and safe null handling.
Explore how enumerable and enumerator interfaces enable iteration, including generic IEnumerable<T> and IEnumerator<T>, and how list and dictionary interfaces define add, remove, indexers, and key-value access.
Explore arrays in .NET: fixed size, initialization options, length and index of methods, array class search utilities, and resizing with ref, leading to the recommended use of lists for flexibility.
Explore how the list serves as a generic, typesafe super array in c# and .net, with constructors, add, insert, remove, contains, and find or find all.
Learn how a dictionary maps keys to values for fast lookups in C# and .NET, using generic key/value types, addition, indexing, and safe retrieval with try get value.
SortedList stores key-value pairs like a dictionary but uses a binary search for indexing. It trades memory usage and performance, favoring sorted lists for small collections.
Explore the hash set, a generic collection that removes duplicates and enables union, intersect, and overlaps to compare and merge multiple collections.
Explore the sorted set, a unique collection that sorts on insert, removes duplicates, and supports union, intersection, and symmetric difference with other collections, including view ranges via GetViewBetween.
Learn how a queue implements first in first out semantics with enqueue and dequeue, peek to inspect the head item, and count and copy to an array, without random access.
Learn how stacks deliver LIFO behavior in C# and .NET, using push, pop, and peek, and implement browser-style back and forward navigation with two stacks.
Learn to create custom collections in C# and .NET by inheriting from system collections object model and overriding insert item and set item to filter values.
Learn how binding list enables data binding, fires the ListChanged event on add, remove, or reorder, and automatically updates bound controls like a combo box in Windows Forms.
Explore how keyed collections blend list and dictionary by using the value’s id as the key. Inherit from KeyedCollection to build an employee collection and implement GetKeyForItem for key extraction.
Protect internal data by exposing a read only collection or read only dictionary instead of a mutable list, enabling safe enumeration.
Explore how a read only observable collection enables observing changes without allowing edits, by casting to INotifyCollectionChanged or using explicit typing as the consumer.
Explore the thread-safe concurrent dictionary from System.Collections.Concurrent, using try add, try remove, try update, and get or add to manage keys across multiple threads without exceptions.
Explore the system.collections.concurrent types: concurrent queue, concurrent stack, and concurrent bag, including enqueue, try peek, try dequeue, push, try pop, and range variants for multithreaded scenarios.
Learn how the IEnumerator interface powers foreach by exposing Current and MoveNext, with GetEnumerator returning an enumerator; compare generic and non-generic versions and manual enumeration with a list.
Explore how the yield keyword simplifies creating enumerators in C#, turning enumeration into a state machine. Learn yield return, yield break, and when not to use yield.
Learn to implement the IEnumerable interface in C# and .NET, using IEnumerable<T> and yield return, from simple classes to a basic person collection.
Explore how attributes add metadata and enable validation via System.ComponentModel.DataAnnotations. Balance collections beyond lists and dictionaries, such as queue and keyed collection, while noting HttpGet and HttpPost attributes in MVC.
In this Collections in C# and .NET training course, expert author Jeremy McPeak will teach you how to use the collection classes in the .NET framework. This course is designed for users that are already familiar with the basic fundamentals of C# and the .NET framework.
You will start by learning about attributes, then jump into learning about common collections, including working with arrays, the HashSet, and the SortedSet. From there, Jeremy will teach you how to create your own collection with Collection, bind data with BindingList, and prevent collection modifications with ReadOnlyCollection. Finally, you will learn about concurrent collections and how to write iterators.
Once you have completed this computer based training course, you will have gained a solid understanding of what the collection classes are in the .NET framework and how to use them. Working files are included, allowing you to follow along with the author throughout the lessons.