You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just catching up and updating from 12.1 to 12.2. I knew the explicit processor registration changes had been made, and needed to do some refactoring here.
I've got all my Pre/Post processors being explicitly registered on startup when calling AddMediatr(). Also have a nice little test in place which flags up any IPreProcessors that have not been explicitly registered.
However, I noticed I have some issues in scenarios where I have PipelineBehaviours for cross cutting concerns, particularly authorisation checks.
I have an AuthCheckBehaviour which was always explicitly registered. With Mediatr 12.1 my Behaviours would execute first, and then any pre-processors if they exist for the TRequest. In 12.2 it looks like the RequestPreProcessorBehavior is handling the request first, before my AuthBehaviour.
I can see looking at the commits for #922 that the RequestPreProcessorBehavior and RequestPostProcessorBehavior are now being registered before the serviceConfiguration.BehaviorsToRegister are being registered.
Could I just double check if that is correct, and also is there a way that I can configure my pipeline so that my Authorisation behaviour is called before the RequestPreProcessorBehavior? I tried to explicitly register the RequestPreProcessorBehavior in .AddMediatr() after my behaviours, but that didn't work.
Many thanks
Paul
The text was updated successfully, but these errors were encountered:
Hi Jimmy and all
I'm just catching up and updating from 12.1 to 12.2. I knew the explicit processor registration changes had been made, and needed to do some refactoring here.
I've got all my Pre/Post processors being explicitly registered on startup when calling AddMediatr(). Also have a nice little test in place which flags up any IPreProcessors that have not been explicitly registered.
However, I noticed I have some issues in scenarios where I have PipelineBehaviours for cross cutting concerns, particularly authorisation checks.
I have an AuthCheckBehaviour which was always explicitly registered. With Mediatr 12.1 my Behaviours would execute first, and then any pre-processors if they exist for the TRequest. In 12.2 it looks like the RequestPreProcessorBehavior is handling the request first, before my AuthBehaviour.
I can see looking at the commits for #922 that the RequestPreProcessorBehavior and RequestPostProcessorBehavior are now being registered before the serviceConfiguration.BehaviorsToRegister are being registered.
Could I just double check if that is correct, and also is there a way that I can configure my pipeline so that my Authorisation behaviour is called before the RequestPreProcessorBehavior? I tried to explicitly register the RequestPreProcessorBehavior in .AddMediatr() after my behaviours, but that didn't work.
Many thanks
Paul
The text was updated successfully, but these errors were encountered: