Menu

1 / 10

C# 15 Unpacked: Popping the Hood on Unions and Finding a Struct

DEV Community: dotnet·Giorgi Kobaidze·14 days ago
#o3HkO7AA
#devtodotnet#devto#dev#union#unions
Long article (2107 words) — no AI summary yet.
Reading 0:00
15s threshold

All the code in this series is available on GitHub. Clone it, run it, and try breaking it yourself.

.NET 11 & C# 15 Playground

A lightweight playground repository for experimenting with and testing new features introduced in .NET 11 and C# 15 .

Use it to explore language changes, try out APIs, and validate ideas in isolation without production constraints. Each feature lives in its own small project, often with a "before" and "after" version so you can see what the new feature actually changes.

What's inside

Project Feature Description

Unions Union types A small console login flow that compares the classic class-hierarchy approach with C# 15 unions and compiler-checked exhaustive matching.

More examples will be added as new features are explored.

Getting started

You'll need the .NET 11 SDK . Then clone the repo and run any example:

dotnet run --project src/Unions

Enter fullscreen mode

Exit fullscreen mode

Disclaimer

.NET 11 and C# 15 features may still change.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.