# C# result pattern

Published articles for C# result pattern.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## C# 15 Union Types for API Results: Examples, Trade-Offs, and Migration

DevFeed: [C# 15 Union Types for API Results: Examples, Trade-Offs, and Migration](<https://devfeed.tech/articles/c-15-union-types-for-api-results-examples-trade-offs-and-migration-92884.md>)

Original publisher: [Read original article](<https://www.syncfusion.com/blogs/post/csharp-15-union-types-api-results>)

Author: Arunachalam Kandasamy Raja

Published: 2026-10-21T14:17:46Z

Content type: article

Language: en

Sources: [Syncfusion](<https://devfeed.tech/sources/syncfusion-blogs.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [ASP.NET](<https://devfeed.tech/topics/aspnet.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [asp-net-core](<https://devfeed.tech/tags/asp-net-core.md>), [business](<https://devfeed.tech/tags/business.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [c-sharp-15](<https://devfeed.tech/tags/c-sharp-15.md>), [c-sharp-15-union-types](<https://devfeed.tech/tags/c-sharp-15-union-types.md>), [c-sharp-discriminated-unions](<https://devfeed.tech/tags/c-sharp-discriminated-unions.md>), [c-sharp-result-pattern](<https://devfeed.tech/tags/c-sharp-result-pattern.md>), [c-sharp-union-types](<https://devfeed.tech/tags/c-sharp-union-types.md>), [c-sharp-union-types-in-asp-net-core](<https://devfeed.tech/tags/c-sharp-union-types-in-asp-net-core.md>), [cases](<https://devfeed.tech/tags/cases.md>), [compare](<https://devfeed.tech/tags/compare.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [examples](<https://devfeed.tech/tags/examples.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [migration](<https://devfeed.tech/tags/migration.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-development](<https://devfeed.tech/tags/net-development.md>), [net-development-asp-net-core-c-sharp-software-architecture-web-platform-apis-what-s-new](<https://devfeed.tech/tags/net-development-asp-net-core-c-sharp-software-architecture-web-platform-apis-what-s-new.md>), [net-sdk](<https://devfeed.tech/tags/net-sdk.md>), [results](<https://devfeed.tech/tags/results.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [types](<https://devfeed.tech/tags/types.md>), [union](<https://devfeed.tech/tags/union.md>), [union-types](<https://devfeed.tech/tags/union-types.md>), [web-api](<https://devfeed.tech/tags/web-api.md>), [web-platform-apis](<https://devfeed.tech/tags/web-platform-apis.md>), [what-s-new](<https://devfeed.tech/tags/what-s-new.md>)

### AI overview

C# 15 union types represent a fixed set of result cases and let the compiler flag unhandled cases in switch expressions. In the ASP.NET Core example, a service returns distinct order outcomes while a controller maps them to HTTP responses, keeping business logic separate from HTTP handling. Unions suit closed sets of expected outcomes; interfaces better fit extensible implementations, and an established Result<T> may already meet a project's needs. Generated unions store cases through object?, so value types may box; the text recommends measuring performance-sensitive use. JSON deserialization can be ambiguous when structural case shapes overlap, and explicit polymorphic serialization may suit APIs needing a stable discriminator. Because unions are preview features in the C# 15/.NET 11 development cycle, migration guidance is to update internal consumers first and check response contracts, OpenAPI, generated clients, and serialized or persisted data before removing an old result model.

### Source excerpt

Learn how C# 15 union types simplify ASP.NET Core API results, compare with existing C# patterns, and help you decide when to adopt them.