C#C#

Learn C# – all lessons

16 lessons from beginner to advanced, building on each other and with code examples.

Beginner
1

Hello World & Top-Level Statements

Your first C# program and how output works.

2

Variables & Data Types

Numbers, text, booleans, var and conversions.

3

Conditions: if, switch & Co.

Making decisions in code, including with switch expressions.

4

Loops: for, foreach, while

Repeating tasks – over numbers and collections.

5

Methods

Reusable building blocks of code with parameters and return values.

6

Arrays, Lists, Dictionaries, Sets

The most important collection types and how to use them.

Intermediate
7

Classes, Inheritance & Records

Custom data types with properties, behavior and value semantics.

8

Nullable Reference Types

Catch null errors at compile time.

9

LINQ: Querying Data

Filter, transform, sort and group with one consistent syntax.

10

Error Handling & Files

Exceptions, custom error types and working safely with files.

11

Pattern Matching

Elegantly test and deconstruct types, properties and structures.

Advanced
12

async/await & Tasks

Concurrent I/O without blocked threads.

13

Interfaces & Generics

Define contracts and write type-safe, reusable code.

14

Delegates, Lambdas & Events

Pass functions as values and react to events.

15

Value Types, IDisposable & Span

How memory, copies and resources work in .NET.

16

Modern C# 10–12

Primary constructors, collection expressions, raw strings and more.