Moved QueryContext action parameter initialization to more common place #213
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.
Hi Jouke,
We had a case when WebApi action has
ObjectContext
parameter and thenHandlesQuery
attribute passes currentObjectContext
value as paramter. So endpoint can consume\handle current context.I did two changes there:
I moved that code that initialize
ObjectContext
in action's parameter to more common placeQueryContextUtils
so now it will be available to any action that needs it, and not only by action that hasHandlesQuery
. So if endpoint withAllowsQuery
wants to get current context for logging\other reasons, then it can get itI also added
Fieldset
initialization toHandlesQuery
so now it also can usefields
logic too. As before that it would ignore it andObjectContext
won't parse actualFieldset
value