Draft
Conversation
Member
Author
|
/AzurePipelines run OData-AspNetCoreOData-main-rolling-1ES |
|
No pipelines are associated with this pull request. |
Member
Author
|
/AzurePipelines run OData-AspNetCoreOData-main-rolling-1ES |
|
No pipelines are associated with this pull request. |
Member
Author
|
/AzurePipelines run OData-AspNetCoreOData-main-rolling-1ES |
|
No pipelines are associated with this pull request. |
xuzhg
reviewed
Jun 19, 2025
| /// <param name="validationSettings">The validation settings.</param> | ||
| /// <param name="validationErrors">Contains a collection of validation errors encountered, or an empty collection if validation succeeds.</param> | ||
| /// <returns><see langword="true"/> if the validation succeeded; otherwise, <see langword="false"/>.</returns> | ||
| bool TryValidate(ComputeQueryOption computeQueryOption, ODataValidationSettings validationSettings, out IEnumerable<string> validationErrors); |
Member
There was a problem hiding this comment.
In this pattern, shall we call 'Validate' within 'TryValidate' and avoid duplicate the validation codes?
Member
There was a problem hiding this comment.
To avoid breaking changes, can we use the default interface method so we don't avoid the breaking changes?
Member
There was a problem hiding this comment.
Is it the time to add 'async' interface method?
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.
Issues
This pull request fixes #1419.
Description
This PR introduces a
TryValidatemethods toODataQueryOptionsaddressing the current limitation where query options can only be validated by throwing exceptions.The
TryValidatemethod provides a way to validate query options without relying on exception handling. Instead of relying on exception handling, this method returns a bool indicating success or failure and provides detailed validation errors through an out parameter.Example Usage:
Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.