Closed Class Hierarchies in C# 15: Exhaustive Matching Comes to Inheritance
C# 15 introduces the closed modifier for class hierarchies, restricting derivation to the declaring assembly and enabling exhaustive switch expressions without a default arm. Here is how it works, how it differs from unions and sealed classes, and where it fits in domain modelling.
Union Types in C# 15: Exhaustive Pattern Matching Without the Workarounds
C# 15 introduces union types with the union keyword, bringing implicit conversions, exhaustive switch expressions, and compiler-enforced closed type sets to .NET. Here is what they look like, how they lower to structs, and where they replace the OneOf hacks.
Switch Expressions: Concise Branching in C#
How switch expressions replace verbose switch statements with concise, expression-based branching that returns values directly.
Pattern Matching Deep Dive in C#
A comprehensive look at C# pattern matching, from type patterns to recursive and relational patterns that simplify complex conditional logic.