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

The .NET Substrate

The Dispose pattern and IAsyncDisposable, value types and Span, nullable reference types and records, and proving a design works with xUnit and NSubstitute before the patterns chapters begin.

Chapter 7

The Dispose pattern and IAsyncDisposable

Dispose(bool), finalizer interaction, using and await using, and the closest C# gets to RAII, specified by the Framework Design Guidelines.

Read โ†’
Chapter 8

Value types: struct, readonly struct, and Span

When a value type is the right choice, and the C# 14 implicit span conversions that make Span ergonomic.

Read โ†’
Chapter 9

NRTs, records, and init/required/with

Immutability as a design tool, and why nullable reference types remove the motivation for the Null Object pattern.

Read โ†’
Chapter 10

Proving it works: xUnit and NSubstitute

The testing baseline every later chapter uses, with xUnit for test structure and NSubstitute for collaborator substitution.

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