saule
saule copied to clipboard
Moved QueryContext action parameter initialization to more common place
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:
-
I moved that code that initialize
ObjectContextin action's parameter to more common placeQueryContextUtilsso now it will be available to any action that needs it, and not only by action that hasHandlesQuery. So if endpoint withAllowsQuerywants to get current context for logging\other reasons, then it can get it -
I also added
Fieldsetinitialization toHandlesQueryso now it also can usefieldslogic too. As before that it would ignore it andObjectContextwon't parse actualFieldsetvalue
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.
@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