-
In V12 and the removal of where VoidRequest is public class VoidRequest: IRequest {} But modify VoidRequest to be public class VoidRequest: IRequest<Unit> {
...
return Unit.Value;
} Thanks, |
Beta Was this translation helpful? Give feedback.
Answered by
jbogard
Feb 16, 2023
Replies: 1 comment 1 reply
-
I added some notes to the upgrade guide around void requests and behaviors: https:/jbogard/MediatR/wiki/Migration-Guide-11.x-to-12.0 Short answer - leave your request alone, but you'll need to make your pipelines/processors return public class VoidRequest: IRequest {}
public class VoidRequestPostProcessor : IRequestPostProcessor<VoidRequest, Unit> {
public Task Process(VoidRequest request, Unit response, CancellationToken cancellationToken)
{
// do some work, whatever
return Task.CompletedTask;
}
} This works because I also removed the generic constraints on behaviors of |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jafin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added some notes to the upgrade guide around void requests and behaviors:
https:/jbogard/MediatR/wiki/Migration-Guide-11.x-to-12.0
Short answer - leave your request alone, but you'll need to make your pipelines/processors return
Unit
. This was to avoid dual pipelines/processors etc:This works because I also removed the generic constraints on behaviors of
where TRequest : IReque…