Skip to content

feat: .NET 11#339

Draft
hhvrc wants to merge 7 commits into
developfrom
feat/dotnet11
Draft

feat: .NET 11#339
hhvrc wants to merge 7 commits into
developfrom
feat/dotnet11

Conversation

@hhvrc

@hhvrc hhvrc commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

hhvrc added 3 commits July 17, 2026 20:59
Prerequisite for adopting C# union types (discriminated unions),
which ship as a preview language feature in .NET 11.
Converts every OneOf<T0,...>/OneOf.Types usage to C# union declarations
(union keyword, LangVersion=preview), the structural-union language
feature shipped in .NET 11 Preview 2.

- Common/Results/Unions.cs: generic Union2<T0,T1>..Union8<..> declarations
  replacing OneOf<T0,...T7>.
- Common/Results/CommonResultCases.cs: Success, Success<T>, NotFound,
  Error, Error<T>, None replacing OneOf.Types.
- Rewrote every .Match/.Switch/.TryPickTx/.AsTx/.IsTx call site to
  switch expressions/statements and `is` patterns, since union
  declarations only expose a Value property plus constructors (no
  generated helper methods).
- Removed the OneOf package reference from Common.csproj and
  Directory.Packages.props.

Note: OpenShock.Common.Results.NotFound/Unauthorized share a name with
inherited ControllerBase.NotFound()/.Unauthorized() methods, so a few
controller files alias the namespace (`using Results = ...`) to
disambiguate bare switch-pattern usage.
Enables the runtime-async feature switch solution-wide so async
methods suspend/resume via the runtime instead of compiler-generated
state machines: cleaner stack traces, better debuggability, lower
overhead. No source changes needed - this only affects codegen.
@stage-review

stage-review Bot commented Jul 17, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants