Closed Fandermill closed 1 year ago
Why are you not using IPipelineBehavior<,>
instead? I think in general that is the extension point there to use.
Thanks for your reply!
Yeah, I found this post from mr Bogard from 2016 and the pre processor seems to be intended for request specifics. So yeah, I think you are right. I'll go with the IPipelineBehavior<,>
.
(https://lostechies.com/jimmybogard/2016/10/13/mediatr-pipeline-examples/)
I'm having trouble getting my IRequestPreProcessor registered with this package.
Let's say I want to log all IRequests that go through the pipeline, no matter what type of IRequest really is. So I create this class:
I then do this with a
ContainerBuilder
to register Mediatr:So I was expecting that
.WithAllOpenGenericHandlerTypesRegistered()
would pick up my LoggingPreProcessor, but it does not.When I add this to the registration, it does get registered and called in the pipeline:
So I guess that
.WithAllOpenGenericHandlerTypesRegistered()
only takes closed implementations of Mediatr interfaces, right? Is this on purpose? Or am I missing something?For open implementations of pipeline behavior, there is
.WithCustomPipelineBehaviors()
, but that only takes types ofIPipelineBehavior<,>
and theIRequestPreProcessor<>
is not.