Closed don-flamingo closed 1 year ago
I have the same bug in my application.
Have a repro? The tests look fine here.
Looks like it happens when I have IRequestHandler
Ok, I Found it. It happens when Pipeline implementation looks like
public class ValidationPipeline<TRequest, TResponse> :
IPipelineBehavior<TRequest, TResponse>
where TRequest : IRequest<TResponse>
When I changed into
public class ValidationPipeline<TRequest, TResponse> :
IPipelineBehavior<TRequest, TResponse>
where TRequest : IRequest
Void pipelines works correctly, but.... When handler return something, in the upper case not working.
So, currently to hack it, I must have 2 pipelines instead of 1.
Did you follow the upgrade guide?
I added a big bold message to also correct your behaviors:
https://github.com/jbogard/MediatR/wiki/Migration-Guide-11.x-to-12.0
That will fix your issue.
Hey!
I have pulled the newest 12.00 MediatR version into my modular monolith application. Previously, I registered my validation pipeline as the code:
After migration, the validation doesn't work correctly. I have checked the lib methods and transformed the upper piece of code into
But still without success.
Btw. when I have skipped RegisterServicesFromAssembly(typeof(Program).Assembly); the library throws an exception - no assemblies to scan. It's problematic because a program is only a shared entry point to my app.
My app looks like this: WebApi - Controllers, Entrypoint, ModuleA - Logic for A, Command handlers, ModuleB - logic for B, Bommand handlers, etc.