Support FromBody parameters with actions and functions - #579
Merged
xuzhg merged 1 commit intoApr 27, 2022
Merged
Conversation
gathogojr
force-pushed
the
fix/571-support-frombody-parameters-with-actions-and-functions
branch
from
April 27, 2022 09:37
fde37b8 to
99e496b
Compare
gathogojr
requested review from
ElizabethOkerio,
KenitoInc,
Nthemba,
habbes and
xuzhg
April 27, 2022 09:41
Contributor
|
@gathogojr please add description of the changes you've made. |
|
|
||
| ODataPath path = request.ODataFeature().Path; | ||
| IEdmNavigationSource targetNavigationSource = GetTargetNavigationSource(path, model); | ||
| IEdmNavigationSource targetNavigationSource = path.GetNavigationSource(); |
Contributor
There was a problem hiding this comment.
I don't think I understand why you did away with the GetTargetNavigationSource method. and called the path.GetNavigationSource directly. Does it mean the path.LastSegment is always null at this point?
Contributor
Author
There was a problem hiding this comment.
The GetTargetNavigationSource method defined in this class was a workaround to the problem that we're fixing from the TryTranslate methods of ActionSegmentTemplate and FunctionSegmentTemplate. It's not necessary to return it after the fix that we applied
gathogojr
force-pushed
the
fix/571-support-frombody-parameters-with-actions-and-functions
branch
from
April 27, 2022 11:42
99e496b to
7813059
Compare
gathogojr
force-pushed
the
fix/571-support-frombody-parameters-with-actions-and-functions
branch
from
April 27, 2022 12:48
7813059 to
c3564f2
Compare
ElizabethOkerio
approved these changes
Apr 27, 2022
xuzhg
approved these changes
Apr 27, 2022
Merged
1 task
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.
Fixes #571
The target navigation source is unresolved at the time of initializing an
ActionSegmentTemplateand aFunctionSegmentTemplate. For that reason, theNavigationSourceproperty of theODataSegmentTemplateis initialized tonull. Subsequently when we create anOperationSegmentfrom theTryTranslatemethod of either of the two templates, theEdmTypeandEntitySetproperties of the segment are initialized to null. This is the reason for the error exhibited in the reported issue.We fix the issue in this PR by using the entity set annotation to get the target navigation source. This annotation is set when
ReturnsFromEntitySetmethod (and similar variants) are called when using the model builder to initialize the Edm model.By fixing this we dealt with a technical debt in the form of a comment left in
ODataOutputFormatterHelper