Skip to content
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

Moved QueryContext action parameter initialization to more common place #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sergey-litvinov-work
Copy link
Contributor

Hi Jouke,

We had a case when WebApi action has ObjectContext parameter and then HandlesQuery attribute passes current ObjectContext value as paramter. So endpoint can consume\handle current context.

I did two changes there:

  1. I moved that code that initialize ObjectContext in action's parameter to more common place QueryContextUtils so now it will be available to any action that needs it, and not only by action that has HandlesQuery. So if endpoint with AllowsQuery wants to get current context for logging\other reasons, then it can get it

  2. I also added Fieldset initialization to HandlesQuery so now it also can use fields logic too. As before that it would ignore it and ObjectContext won't parse actual Fieldset value

…ce so it will be available for every saule's call

Enabled Fieldset filter for HandlesQuery case too
@joukevandermaas
Copy link
Owner

Thanks, this looks quite useful!

Just to make sure, this is not a breaking change, correct? It seems like it is not, but I'd rather make sure.

Also, do you think it is possible to write a test for this new functionality? I'd love not to break it accidentally in the future.

@sergey-litvinov-work
Copy link
Contributor Author

@joukevandermaas sorry for so long answer. I missed your answer. so it didn't work for us so well, so we handled it in different way on top of Saule. It shouldn't be breaking changes as initially it worked only for HandlesAttribute and after that change it will be working for every case

If you want this change, i can add more unit tests and update PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants