14 min read
C# 15 Union Types in ASP.NET Core Minimal APIs
Learn how to use C# 15 union types in ASP.NET Core 11 Minimal APIs. We declare unions, use exhaustive pattern matching, accept and return them as JSON, see how they show up in OpenAPI, and compare them with closed class hierarchies.