.NET (OK, C#) finally gets union types🎉: Exploring the .NET 11 preview - Part 2

· · May 19, 2026, 11:38 a.m.
Summary
This is the second post in the series: Exploring the .NET 11 preview. Part 1 - Running background tasks in Blazor with Web WorkersPart 2 - .NET (OK, C#) finally gets union types🎉 (this post) Part 3 - Avoiding ToString() allocations with StringBuilder.MoveChunksPart 4 - Closed class hierarchiesPart 5 - Improvements to reading Process outputsPart 6 - Automatic CSRF protection based on Fetch Metadata headersPart 7 - The pain of serializing unions and closed class hierarchies with System.Text.JsonP...