Why do not you use IPipelineBehavior ?!
GitHub :                                 bugandfix        /          CQRS-PipelineBehaviour      ...
Tags: cqrs, mediatr, csharp, aspnet