C# (.NET 8 LTS) · 22 lessons
Basics → OOP → Collections/LINQ → Exceptions & I/O → Modern C# (async, NRT, patterns, records)
22-lesson track on .NET 8 LTS: basics, OOP, collections/LINQ, exceptions/IO, and modern C# (async, NRT, patterns, records). Each lesson includes the full tutorial, runnable example code (`src/*.cs`), a homework task and a reference solution.
Part 1: Basics
5 lessons
Getting Started with C#
Set up the .NET SDK and tooling, then build and run your first C# console application.
Variables and Types
Declare variables and work confidently with C# value types, reference types and type inference.
Operators and Expressions
Use C# operators to calculate values, compare results and handle nulls safely.
Control Flow
Branch and repeat work with conditionals, switch expressions and the main loop forms.
Methods
Break programs into reusable methods and pass data with overloads, ref modifiers and optional arguments.
Part 2: Object-Oriented Programming
5 lessons
Classes and Objects
Model data and behaviour with classes, constructors and the right access modifiers.
Properties and Encapsulation
Protect object state with properties, init-only setters, required members and validation.
Inheritance
Reuse and extend existing classes with inheritance, virtual methods and controlled overriding.
Polymorphism
Call the right implementation through base references and use casts and abstract classes safely.
Interfaces
Define contracts with interfaces, implement several at once and program against abstractions.
Part 3: Collections & LINQ
4 lessons
Arrays
Store fixed-size data in one- and two-dimensional arrays and use Span and Memory for slices.
List, Dictionary, HashSet
Choose the right collection for ordered lists, key-value lookups, unique sets, queues and stacks.
Generics
Write reusable, type-safe generic code and understand how variance works.
LINQ
Query collections declaratively with LINQ, from filtering and projection to grouping and aggregation.
Part 4: Exceptions & I/O
3 lessons
Exception Handling
Handle failures with try, catch and finally, filter exceptions and throw meaningful errors.
File I/O
Read and write text files with File, StreamReader and Path while handling I/O failures.
String Handling
Process text with string methods, interpolation, StringBuilder and regular expressions.
Part 5: Modern C#
5 lessons
Delegates and Lambdas
Pass behaviour with delegates and lambdas, and publish or subscribe to events.
async/await
Run I/O-bound work asynchronously with Task, await, cancellation and ConfigureAwait.
Nullable Reference Types
Turn on nullable reference types and handle nulls with ?., ?? and the null-forgiving operator.
Pattern Matching
Use modern pattern matching to make type checks and branching safer and clearer.
Records and init
Create immutable data types with records, init-only setters, value equality and with expressions.