Skip to content

#12 - Adds ability to convert a generic result to a non-generic result - #14

Merged
paulirwin merged 4 commits into
mainfrom
issue/12
Nov 7, 2025
Merged

#12 - Adds ability to convert a generic result to a non-generic result#14
paulirwin merged 4 commits into
mainfrom
issue/12

Conversation

@mlienau

@mlienaumlienau commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

Fixes#12

CopilotAI review requested due to automatic review settings November 7, 2025 17:49
@github-actions

github-actionsBot commented Nov 7, 2025

Copy link
Copy Markdown

Test Results

2 files ± 0 2 suites ±0 1s ⏱️ -1s
138 tests + 5 138 ✅ + 5 0 💤 ±0 0 ❌ ±0 
276 runs +10 276 ✅ +10 0 💤 ±0 0 ❌ ±0 

Results for commit a7f161f. ± Comparison against base commit 240608e.

♻️ This comment has been updated with latest results.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new Map() method to the generic Result<T> class that converts it to a non-generic Result instance. This is useful when the value associated with a result is no longer needed but the result status should be preserved.

Key changes:

  • Added Map() method to convert Result<T> to Result
  • Added comprehensive test coverage for all result type conversions
  • Minor formatting adjustment to semicolon placement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
src/F23.Kernel/Result.csImplements the new Map() method using a switch expression to handle all result types, plus minor formatting fix
src/F23.Kernel.Tests/ResultMappingTests.csAdds 5 test cases covering all result type conversions (Success, ValidationFailed, ValidationPassed, Unauthorized, PreconditionFailed)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/F23.Kernel.Tests/ResultMappingTests.cs Outdated
Comment threadsrc/F23.Kernel/Result.cs Outdated
@github-actions

Copy link
Copy Markdown

Code Coverage

PackageLine RateBranch RateComplexityHealth
F23.Kernel94%88%133
F23.Kernel.AspNetCore100%100%155
Summary97% (316 / 327)97% (198 / 204)288

@paulirwin
paulirwin merged commit 0f47591 into mainNov 7, 2025
4 checks passed
@paulirwin
paulirwin deleted the issue/12 branch November 7, 2025 18:43
@paulirwinpaulirwin added the notes:breaking-change List under Breaking Changes for release notes label Nov 7, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:breaking-changeList under Breaking Changes for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to convert from Generic Result to Non-Generic Result

3 participants

@mlienau@paulirwin