---
title: "Discussion on \"How to Implement Type Safe Unions in C# With OneOf\" | Hashnode"
description: "Discussion on \"How to Implement Type Safe Unions in C# With OneOf\". Have you ever needed a method to return different types depending on the situation? Perhaps a payment processor that returns different payment types, an order that can be in various states with different data, or better, a file loader that handles mu..."
url: "https://hashnode.com/posts/how-to-implement-type-safe-unions-in-c-with-oneof/6973f8cd15349392f17d3760"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Implement Type Safe Unions in C# With OneOf](https://freecodecamp.org/news/how-to-implement-type-safe-unions-in-c-with-oneof?utm_source=hashnode&utm_medium=feed)

Have you ever needed a method to return different types depending on the situation? Perhaps a payment processor that returns different payment types, an order that can be in various states with different data, or better, a file loader that handles mu...

Jan 23 · 12 min read · freecodecamp.org  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)

## Written by

[Grant Riordan](https://hashnode.com/@grantdotdev)

@grantdotdev · Leeds,UK

  
[View profile](https://hashnode.com/@grantdotdev)

Lead Devoloper and Tech Author

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
