You can make the C# code much more F# like with records and a switch expression.

Eg: https://sharplab.io/#v2:EYLgZgpghgLgrgJwgZwLQAUEEsC2UECeAwgP...

Microsoft has a good tutorial that showcases what you can do when designing with switch expressions in mind:

https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals...

Probably one of my favorite recent-ish additions to the language.

The fact that they've added all of this great stuff and have STILL not added real discriminated unions is a damn travesty. It would just so drastically improve the language.

Agree.

For now, you can get a reasonable DU via an [external library](https://github.com/mcintyre321/OneOf).

[Nick Chapsas Video on Usage](https://www.youtube.com/watch?v=7z-xjijYfcI).