Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

C#

Modern C# 14 on .NET 10, from your first line of code to tested, packaged, professional software, with the tools underneath never hidden.

Free to read now, no account needed: Before you start: programs, files, and the terminal. Create a free account to open the other chapters, take the quizzes and keep your progress.

My setup

Lessons that differ by operating system or tool show your choice first, and fold away notes meant for other setups. You can switch tabs in any lesson β€” it remembers what you pick.

Operating system

Environment

Database

Part 1

Getting started

Chapters 0–1 ›

1 Set up and run C# πŸ”’

Create a free account to open this chapter.

  • The SDK, the runtime, and your tools ~20 min
  • Install the .NET SDK ~25 min
  • Your first program ~25 min
  • Your first project ~25 min
  • Choosing an environment ~35 min
  • Save your work with Git ~30 min
  • From source code to a running program ~25 min
  • Assemblies, namespaces, and libraries ~30 min
  • Reading errors and warnings ~30 min
Part 2

Language foundations

Chapters 2–7 ›

2 Values, types, and operators πŸ”’

Create a free account to open this chapter.

  • Variables and literals ~25 min
  • Numbers ~30 min
  • Text and truth ~25 min
  • Constants, var, and comments ~25 min
  • Conversions ~35 min
  • Statements and expressions ~30 min
  • Arithmetic ~30 min
  • Assignment and increment ~25 min
  • Comparison and logic ~30 min
  • Bitwise and shift operators ~25 min
  • The conditional operator and precedence ~35 min

3 Console input and output πŸ”’

Create a free account to open this chapter.

  • Writing output ~20 min
  • Interpolation and formatting ~30 min
  • Reading input and null ~25 min
  • Parsing and TryParse ~30 min
  • Validating input ~35 min

4 Control flow πŸ”’

Create a free account to open this chapter.

  • if and else ~35 min
  • switch statements and expressions ~40 min
  • while and do loops ~35 min
  • for and foreach loops ~40 min
  • break, continue and return ~30 min
  • Tracing a program ~45 min

5 Methods πŸ”’

Create a free account to open this chapter.

  • Defining and calling methods ~30 min
  • Parameters and return values ~35 min
  • ref, out, and in ~35 min
  • Overloading and params ~35 min
  • Expression-bodied methods and local functions ~30 min
  • Recursion and the call stack ~40 min
  • Designing good methods ~45 min

6 Strings and text πŸ”’

Create a free account to open this chapter.

  • Strings are immutable ~30 min
  • Searching and slicing ~35 min
  • Split, join, replace and trim ~35 min
  • Comparing strings ~35 min
  • StringBuilder and raw string literals ~35 min
  • Regular expressions ~45 min

7 Arrays and collections πŸ”’

Create a free account to open this chapter.

  • Arrays ~45 min
  • List<T> ~45 min
  • Dictionary<TKey, TValue> ~45 min
  • HashSet, Queue, and Stack ~45 min
  • LinkedList, sorted collections, and PriorityQueue ~40 min
  • Read-only, immutable, and frozen collections ~35 min
  • Choosing a collection ~50 min
Part 3

Objects and types

Chapters 8–16 ›

8 Classes and objects πŸ”’

Create a free account to open this chapter.

  • Classes, objects, and references ~45 min
  • Fields and properties ~45 min
  • Indexers ~40 min
  • Constructors and initializers ~45 min
  • Access and encapsulation ~45 min
  • Static members ~40 min
  • Value and reference semantics ~50 min
  • Nested and partial types ~35 min

9 Inheritance and polymorphism πŸ”’

Create a free account to open this chapter.

  • Inheritance ~40 min
  • Virtual methods and override ~45 min
  • Abstract and sealed classes ~40 min
  • The object class ~45 min
  • Type tests and casts ~45 min
  • Composition over inheritance ~50 min

10 Interfaces πŸ”’

Create a free account to open this chapter.

  • What an interface is ~40 min
  • Implementing and using interfaces ~45 min
  • Built-in interfaces ~50 min
  • Default and static interface members ~35 min
  • Programming to interfaces ~50 min

11 Records, structs, and modern types πŸ”’

Create a free account to open this chapter.

  • Enums ~40 min
  • Structs ~40 min
  • Records and with expressions ~45 min
  • init, required, and primary constructors ~45 min
  • Tuples and deconstruction ~40 min
  • Modern syntax ~50 min
  • object and dynamic ~30 min

12 Operators, conversions, and extension members πŸ”’

Create a free account to open this chapter.

  • Overloading operators ~45 min
  • Compound assignment and checked operators ~40 min
  • Conversion operators ~40 min
  • Extension methods ~50 min
  • Extension members ~45 min

13 Nullable reference types πŸ”’

Create a free account to open this chapter.

  • Why null crashes ~30 min
  • Annotations and warnings ~40 min
  • The null operators ~40 min
  • Null-state analysis and the ! operator ~45 min
  • Nullable value types ~35 min
  • Fixing null warnings ~50 min

14 Pattern matching πŸ”’

Create a free account to open this chapter.

  • Type and constant patterns ~40 min
  • Relational and logical patterns ~40 min
  • Property and positional patterns ~45 min
  • List patterns ~40 min
  • Switch expressions in depth ~50 min

15 Generics πŸ”’

Create a free account to open this chapter.

  • Why generics exist ~40 min
  • Generic methods and type inference ~40 min
  • Generic classes and interfaces ~45 min
  • Constraints ~50 min
  • Generic math ~55 min
  • Covariance and contravariance ~35 min

16 Delegates, lambdas, and events πŸ”’

Create a free account to open this chapter.

  • Delegates ~40 min
  • Func, Action, and Predicate ~40 min
  • Lambdas and method groups ~40 min
  • Closures ~40 min
  • Events ~45 min
Part 4

Working with data

Chapters 17–20 ›

17 LINQ πŸ”’

Create a free account to open this chapter.

  • Sequences and iterators ~45 min
  • Filtering and projecting ~45 min
  • Sorting ~40 min
  • Finding elements ~45 min
  • Aggregating ~45 min
  • Grouping and joining ~55 min
  • Sets and paging ~50 min
  • Deferred and immediate execution ~50 min
  • Query syntax and IQueryable ~50 min

18 Exceptions πŸ”’

Create a free account to open this chapter.

  • When things go wrong ~40 min
  • try, catch and finally ~45 min
  • Custom exceptions and filters ~45 min
  • Reading stack traces ~40 min
  • Good and bad exception handling ~45 min
  • When not to throw ~45 min

19 Files and serialization πŸ”’

Create a free account to open this chapter.

  • Paths, files, and directories ~40 min
  • Streams, readers, and writers ~40 min
  • CSV files ~45 min
  • JSON with System.Text.Json ~45 min
  • JSON options and source generation ~45 min
  • Binary data ~40 min

20 Dates and times πŸ”’

Create a free account to open this chapter.

  • Choosing a date type ~30 min
  • DateTime and DateTimeOffset ~35 min
  • DateOnly, TimeOnly and TimeSpan ~35 min
  • UTC and time zones ~40 min
  • Formatting and parsing ~40 min
  • Date and time mistakes ~40 min
Part 5

Async, concurrency, and low-level code

Chapters 21–23 ›

21 Asynchronous programming πŸ”’

Create a free account to open this chapter.

  • Why asynchronous code ~35 min
  • Task and await ~50 min
  • Running tasks together ~50 min
  • Cancellation ~45 min
  • Errors in async code ~45 min
  • Async streams ~45 min
  • ValueTask ~45 min
  • Async mistakes and how to avoid them ~50 min

22 Concurrency and parallelism πŸ”’

Create a free account to open this chapter.

  • Threads, tasks and the thread pool ~40 min
  • Race conditions ~45 min
  • Locks, Monitor and Interlocked ~50 min
  • Deadlocks ~40 min
  • Concurrent collections and channels ~45 min
  • Parallel loops ~45 min
  • When concurrency helps ~40 min

23 Memory, resources, and low-level code πŸ”’

Create a free account to open this chapter.

  • Garbage collection ~40 min
  • IDisposable and using ~45 min
  • Async disposal ~35 min
  • Span and Memory ~45 min
  • ref locals, ref returns, and ref readonly ~40 min
  • ref structs and inline arrays ~40 min
  • Unsafe code and pointers ~40 min
  • Calling native code ~45 min
Part 6

Engineering practice

Chapters 24–28 ›

24 Solutions, projects, and MSBuild πŸ”’

Create a free account to open this chapter.

  • Organizing a solution ~40 min
  • The .csproj file ~35 min
  • Properties, items, and targets ~45 min
  • Debug and Release ~40 min
  • Class libraries and project references ~45 min
  • Directory.Build.props and customization ~40 min
  • What a build really does ~40 min
  • The dotnet CLI underneath ~40 min

25 Testing πŸ”’

Create a free account to open this chapter.

  • Why and what to test ~40 min
  • Your first test project ~45 min
  • Arrange, act, assert ~45 min
  • Parameterized tests ~40 min
  • Test doubles and mocking ~50 min
  • Testing async code ~45 min
  • Organizing tests and code coverage ~45 min
  • Integration tests ~45 min

26 Debugging πŸ”’

Create a free account to open this chapter.

  • Breakpoints and stepping ~45 min
  • Watch, Locals, and the Call Stack ~45 min
  • Conditional and exception breakpoints ~50 min
  • Inspecting objects and the Immediate window ~45 min
  • Debugging async code and tests ~45 min
  • Diagnose the broken program ~60 min

27 NuGet πŸ”’

Create a free account to open this chapter.

  • What NuGet is ~35 min
  • Finding and adding packages ~40 min
  • Versions and semantic versioning ~45 min
  • Restore, dependency graphs and lock files ~40 min
  • Sources, feeds and central package management ~45 min
  • Package security ~60 min
  • Create your own package ~55 min

28 Attributes, reflection, and source generators πŸ”’

Create a free account to open this chapter.

  • Attributes ~45 min
  • Attributes the compiler reads ~45 min
  • Reflection ~50 min
  • Expression trees ~45 min
  • Writing a source generator ~60 min
Part 7

Building applications

Chapters 29–32 ›

29 Dependency injection, configuration, and logging πŸ”’

Create a free account to open this chapter.

  • Dependency inversion, revisited ~45 min
  • The service container ~50 min
  • Service lifetimes ~50 min
  • Configuration and options ~50 min
  • Secrets and environment variables ~45 min
  • Structured logging ~55 min
  • The generic host ~50 min
  • The library landscape ~45 min

30 HTTP and calling web APIs πŸ”’

Create a free account to open this chapter.

  • How HTTP works ~45 min
  • REST and JSON ~45 min
  • HttpClient ~50 min
  • IHttpClientFactory and typed clients ~45 min
  • Timeouts and resilience ~55 min

31 Building web APIs with ASP.NET Core πŸ”’

Create a free account to open this chapter.

  • Your first minimal API ~55 min
  • Routing and parameter binding ~55 min
  • Results, status codes and ProblemDetails ~55 min
  • Validation ~55 min
  • The middleware pipeline ~55 min
  • Controllers ~50 min
  • OpenAPI ~50 min
  • DI, configuration and logging in ASP.NET Core ~55 min
  • Testing an API ~55 min

32 Databases and Entity Framework Core πŸ”’

Create a free account to open this chapter.

  • Relational databases and SQL ~45 min
  • DbContext and entities ~45 min
  • Providers and connection strings ~40 min
  • Migrations ~50 min
  • Creating, reading, updating and deleting ~45 min
  • Querying with LINQ ~45 min
  • Relationships and loading related data ~50 min
  • Tracking and no-tracking queries ~40 min
  • Transactions and concurrency ~45 min
  • Raw SQL, Dapper and parameters ~45 min
  • Document databases and MongoDB ~40 min
Part 8

Shipping and craft

Chapters 33–39 ›

33 Publishing and deployment πŸ”’

Create a free account to open this chapter.

  • Build, run, and publish ~40 min
  • Framework-dependent and self-contained ~40 min
  • Runtime identifiers and single-file apps ~40 min
  • Trimming and Native AOT ~45 min
  • Containers ~45 min
  • Continuous integration ~45 min

34 Performance πŸ”’

Create a free account to open this chapter.

  • Measure first ~40 min
  • Benchmarking with BenchmarkDotNet ~45 min
  • Allocations and the garbage collector ~55 min
  • Common hot spots ~60 min
  • Profiling ~45 min

35 Security πŸ”’

Create a free account to open this chapter.

  • Thinking defensively ~45 min
  • Validation as a security boundary ~45 min
  • Protecting secrets ~40 min
  • Authentication and authorization ~60 min
  • Passwords ~45 min
  • Injection ~50 min
  • XSS and HTTPS ~55 min

36 Code quality and team workflow πŸ”’

Create a free account to open this chapter.

  • Naming and formatting ~45 min
  • Warnings and analyzers ~50 min
  • XML documentation ~40 min
  • Refactoring ~55 min
  • Git for .NET projects ~40 min
  • Branches and pull requests ~50 min
  • Merge conflicts ~50 min
  • Code review in practice ~45 min

37 Principles, patterns, and architecture πŸ”’

Create a free account to open this chapter.

  • Principles ~55 min
  • Patterns you already use ~40 min
  • Creating objects ~45 min
  • Wrapping and swapping ~45 min
  • Pipelines and mediators ~45 min
  • Layers and dependency direction ~50 min
  • DTOs, services and repositories ~50 min
  • Right-sizing architecture ~40 min

38 AI-assisted development πŸ”’

Create a free account to open this chapter.

  • What AI assistants are good at ~35 min
  • Explaining code and exploring APIs ~40 min
  • Generating tests and documentation ~40 min
  • Debugging and refactoring with AI ~40 min
  • Verify everything ~45 min

39 Capstone: a complete application πŸ”’

Create a free account to open this chapter.

  • The plan ~40 min
  • The domain and the data ~55 min
  • The API ~55 min
  • The tests ~50 min
  • Shipping it ~50 min

Appendices

Reference chapters on the tools the course uses. Dip in when a lab or a section sends you here; they are not part of the course exam.

A Appendix A: Reading legacy C# and .NET πŸ”’

Create a free account to open this chapter.

  • Modern .NET, .NET Framework, and .NET Standard ~25 min
  • .NET Framework projects and packages ~30 min
  • Old program and syntax forms ~30 min
  • Old collections and libraries ~35 min
  • Old async patterns and web stacks ~35 min
  • Upgrading to modern .NET ~30 min

B Appendix B: C# and .NET version map πŸ”’

Create a free account to open this chapter.

  • .NET releases and support ~20 min
  • C# 7 to C# 9 ~25 min
  • C# 10 to C# 12 ~25 min
  • C# 13 and C# 14 ~30 min
  • What's next: C# 15 and .NET 11 ~20 min

C Appendix C: Environment quick reference πŸ”’

Create a free account to open this chapter.

  • Create, build and run ~20 min
  • Debug and test ~20 min
  • Packages, references and tools ~20 min
  • Refactor, format and publish ~20 min