Union types in C# | DEM304
C# Union types C# language features Microsoft build 2026 Dotnet Mads togersen Dustin campbell Functional programming Discriminated unions Pattern matching Type safety Csharp
This session introduces union types in C#, a new language feature that models closed sets of data shapes commonly used in wire protocols. Speakers Mads Torgersen and Dustin Campbell demonstrate how unions provide cleaner intent expression, type safety through exhaustive switch handling, and confidence in code correctness. The video covers implementation using structs, performance considerations, and custom union patterns for expert C# developers attending Microsoft Build 2026.