๐Ÿงฉ Design Patterns with .NET / C#
Home Chapters Examples Diagrams Bibliography GitHub โ†—
  1. Home
  2. Idiomatic C#
Part 9 5 chapters

Idiomatic C#

Extension members, expression trees, source generators, Roslyn analyzers, and static abstract members: the C# machinery behind the book's most research-heavy part.

Chapter 25

Extension methods and C# 14 extension members

Extension properties, static extension members, and operators, used to decorate or adapt a type you do not own.

Read โ†’
Chapter 26

Expression trees: code as data

Code as inspectable data at runtime: how LINQ providers work, and how to build and inspect trees.

Read โ†’
Chapter 27

Source generators: patterns at build time

Replacing reflection-based factories, registries, and mappers at build time, and the AOT and trimming argument.

Read โ†’
Chapter 28

Roslyn analyzers: patterns enforced at compile time

Encoding a design rule as a build error, and the concrete landing point for the AI throughline.

Read โ†’
Chapter 29

static abstract members and generic math

Constraining a generic over type-level operations with abstract static interface members and generic math over a custom value type.

Read โ†’
โ† Previous part Coordinating and Traversing Next part โ†’ Patterns the Platform Defines
Design Patterns with .NET / C#
Tutorial content: CC BY 4.0. Sample code: Apache 2.0.
Source on GitHub โ†—  ยท  File an issue โ†—