-
Notifications
You must be signed in to change notification settings - Fork 1
#12 - Adds ability to convert a generic result to a non-generic result #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 convertResult<T>toResult - 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.
Fixes #12