Track 3C# & the .NET Runtime
Intermediate C#
The features that make C# expressive and safe: generics, collections, nullability and more.
- 3.1
Value vs reference types
- Copy semantics
- null
- Nullable reference types
- 3.2
Generics
- Generic classes & methods
- Constraints
- 3.3
Collections
- List<T>
- Dictionary<K,V>
- HashSet<T>
- Queue / Stack
- List<T>: the everyday collection— Store, grow, search and reorder sequences of items with List<T>.11 min
- Dictionaries and sets— Look things up by key instantly with Dictionary, and track unique items with HashSet.12 min
- Queues and stacks— Process items in arrival order with Queue<T>, or most-recent-first with Stack<T>.10 min
- 3.4
Exceptions
- try / catch / finally
- Custom exceptions
- When to throw
- 3.5
Modern C# features
- Enums
- Pattern matching
- Extension methods
- Tuples
- Enums— Replace magic numbers and strings with named constants the compiler can check.9 min
- Pattern matching— Test the shape of data — its type, properties and contents — in one readable expression.12 min
- Extension methods and tuples— Add methods to existing types without changing them, and group values without declaring a type.10 min