Example demos

Runnable companions to the book.

Every pattern chapter has a demo behind it. Each demo is a self-contained, standalone-buildable .NET project with an xUnit suite, NSubstitute where a collaborator needs substitution, and no containers. Read the matching chapter for context, then build the demo from its directory with the same local .NET 10 SDK the prerequisites chapter installs.

Runnable examples

Each example makes a single pattern concrete and runnable with one command. Every card links to the demo's page on this site (a rendering of the README with cross-references), and each page links to the source on GitHub. Each demo also stands alone, so you can build it without reading the book first if you would rather poke at it directly.

The runnable examples ship as the chapters land. Check back as the book fills in.

Building every demo

Clone the repo and build every example in one pass with the pinned local toolchain (the .NET 10 SDK; see the prerequisites chapter and scripts/check-prereqs.sh).

git clone https://github.com/patterncatalyst/csharp-design-patterns.git
cd csharp-design-patterns
./scripts/build.sh
./scripts/verify.sh

Every example is also standalone-buildable from its own directory with dotnet test, without configuring the whole repo.