Implementation of IsOkAnd and IsErrAnd#29
Open
mbalzert1978 wants to merge 4 commits intojtmueller:mainfrom
Open
Implementation of IsOkAnd and IsErrAnd#29mbalzert1978 wants to merge 4 commits intojtmueller:mainfrom
mbalzert1978 wants to merge 4 commits intojtmueller:mainfrom
Conversation
- Set current culture to "en-US" to ensure double parsing works outside of the US.
…corresponding value.
…n corresponding error value.
… evaluation and result states.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
Implementation:
The methods
IsOkAndandIsErrAndhave been added to allow checking the status of Result objects.Both methods accept a predicate delegate that is applied to the corresponding value when the result is in the desired state.
Null Check:
Ensured that the predicates are checked for null before being applied to the values to avoid null reference exceptions.
Documentation:
XML documentation for the new methods has been added to clarify their usage and functionality.
Tests:
Unit tests have been written to verify the correct functionality of the new methods and to ensure that the predicates are evaluated properly.
All new tests have passed successfully, confirming the correct implementation of the functionality.
Motivation:
The introduction of these methods enhances the handling of Result objects by providing a clearer and safer way to check the status of results and validate associated conditions. This contributes to more robust error handling in the application.