Union types in C# | DEM304
Microsoft Developer
0:00 / 0:00
Union types in C# | DEM304
21 512 просмотров · 3 месяца назад
Microsoft Developer
696 тыс. подписчиков
21 512 просмотров · 3 месяца назад
Union types are coming to C#! Unions model closed sets of data shapes, as commonly seen in e.g. wire protocols. Mads and Dustin explore the clean expression of intent and the confidence and elegance that unions lend to consuming code.
Seating for this session is first-come, first-served. Add it to your schedule to plan your day and arrive early to secure a spot.
To learn more, please check out these resources:
https://aka.ms/build26/DEM304
https://aka.ms/build26/csharp/union-t...
𝗦𝗽𝗲𝗮𝗸𝗲𝗿𝘀:
Dustin Campbell
Mads Torgersen
𝗦𝗲𝘀𝘀𝗶𝗼𝗻 𝗜𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
This is one of many sessions from the Microsoft Build 2026 event. View even more sessions on-demand and learn about Microsoft Build at https://build.microsoft.com
DEM304 | English (US) | Developer tools & frameworks
Demo | (400) Expert
#MSBuild
Chapters:
0:00 - Introduction by C# team members Mads Torgersen and Dustin Campbell
00:06:50 - Creating calculated properties and managing state
00:07:24 - Restricting unions to functional members without extra state
00:11:00 - Demonstrating exhaustive switch handling for success and error cases
00:13:56 - Explaining union type implementation using structs
00:17:54 - Performance considerations and custom union implementations
00:20:03 - Description of C# feature patterns where users can implement conventions themselves
00:20:20 - Summary of manual union writing and internal struct design for performance considerations
00:24:24 - Conclusion referencing multi-year design process and preview availability in Visual Studio and VS Code