Concept clusters
Related ideas that live chapters apart, pulled onto one page — every way to own memory, every container and when to pick it, and more.
Every way to handle null
string?, is null, ?., ??, ??=, the ! operator, int? and returning null on purpose. What each one says about a missing value, and which to reach for.
13 concepts →
Every way to branch on a value
if and else, the conditional operator, the switch statement, the switch expression, patterns and virtual methods. Same decision, different shapes.
10 concepts →
Every way to loop over data
while, do, for, foreach, LINQ, yield return, recursion, await foreach and parallel loops. Which one says what you mean.
12 concepts →
Every way to pass behaviour around
Virtual methods, interfaces, delegates, Func and Action, lambdas, events and the service container. How to hand code a piece of behaviour it doesn't write itself.
10 concepts →
Every way to model data
class, struct, record, record struct, tuple and enum, plus init, required and primary constructors. Which type to declare for the thing you're describing.
10 concepts →
Every way to compare two values
==, Equals, records, strings, IEquatable
8 concepts →
Every way to handle failure
Exceptions, try/catch/finally, the Try pattern, null, result objects, retries and ProblemDetails. How code says something went wrong, and who deals with it.
11 concepts →
Every way to run work concurrently
async and await, Task.WhenAll, Task.Run, Parallel loops, PLINQ, locks, concurrent collections and channels. Waiting on several things at once versus doing several things at once.
10 concepts →
Every way to release resources
using statements, using declarations, await using, finally, IDisposable, IAsyncDisposable and finalizers. Giving back files, connections and locks on time.
8 concepts →
Every way to configure an app
appsettings.json, appsettings.{Environment}.json, user secrets, environment variables, the command line and the options pattern. Where each setting belongs, and which one wins.
7 concepts →
Every way to ship an app
dotnet publish framework-dependent or self-contained, single file, trimmed, Native AOT, as a container, or as a NuGet package. What each one puts on the other machine.
8 concepts →
Every way to store data
Whole files, streams, CSV, JSON, binary, EF Core on a relational database, raw SQL, Dapper and MongoDB. Where to keep your data, and how to read it back.
11 concepts →
Every way to test your code
Unit tests, parameterized tests, test doubles and mocks, async tests, integration tests and WebApplicationFactory. What each kind proves, and how many of each to write.
11 concepts →