Skip to content

Conversation

@mlienau
Copy link
Contributor

@mlienau mlienau commented Nov 7, 2025

Fixes #12

Copilot AI review requested due to automatic review settings November 7, 2025 17:49
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

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.

Copy link

Copilot AI left a comment

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.

File Description
src/F23.Kernel/Result.cs Implements the new Map() method using a switch expression to handle all result types, plus minor formatting fix
src/F23.Kernel.Tests/ResultMappingTests.cs Adds 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.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
F23.Kernel 94% 88% 133
F23.Kernel.AspNetCore 100% 100% 155
Summary 97% (316 / 327) 97% (198 / 204) 288

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

Labels

notes:breaking-change List 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