Skip to content
0:00 / 0:00

#oneof#discriminatedunions#csharp

A different way to return data in C# with OneOf

Nick Chapsas

429K subscribers • 62 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Nick Chapsas, content creator and educator
  • Linked in the descriptionmcintyre321/OneOf

Intermediate. Assumes working knowledge.

70K views6 years ago2 recommendations

Programming languagesSoftware designC# and .NETFunctional programmingDesign patterns

Nick Chapsas explains how to use the OneOf library to implement F#-style discriminated unions for better return types in C#.

Become a Patreon and get source code access: patreon.com/nickchapsas Check out my courses: dometrain.com Hello everybody I'm Nick and in this video I wanna talk about a package called OneOf. This library provides F# style discriminated unions for C#, using a custom type OneOf. An instance of this type holds a single value, which is one of the types in its generic argument list. It might not be my personal favourite way of doing things but I think it is a good project and I want to give it some exposure because I can definitely see some people benefiting from it. Give OneOf a star: github.com/mcintyre321/OneOf Don't forget to comment, like and subscribe :) Social Media: Follow me on GitHub: bit.ly/ChapsasGitHub Follow me on Twitter: bit.ly/ChapsasTwitter Connect on LinkedIn: bit.ly/ChapsasLinkedIn #dotnet #csharp #oneof

Why it's here

2 people recommend this

What people say. Recommended as a great guide on using the OneOf library to handle multiple return types in C#.

u/dupuis2387in r/dotnet • Recommends

On “Returning bool from all methods and using out for transferring data – Is this a good practice?”

Look into the OneOf library, that does discriminated unions. Vid info on how to use link to this video

u/david622in r/dotnet • Recommends

On “OneOf<>”

Nick Chapsas has a really good video about this library link to this video