title: Have a single Request/RequestHandler for all incoming requests
body: <p>I've been using <a href="https://github.com/jbogard/MediatR" rel="nofollow">MediatR</a> with great degree of success in my current project. The idea of using a <a href="https://lostechies.com/jimmybogard/2014/09/09/tackling-cross-cutting-concerns-with-a-mediator-pipeline/" rel="nofollow">mediator pipeline</a> to tackle cross-cutting concerns is really good.</p>
  
  <p>One thing that I'm not getting (and maybe the reason is my lack of exposure to c# <a href="https://msdn.microsoft.com/en-us/library/ee207183.aspx" rel="nofollow">covariance/contravariance</a>) is how I can handle all incoming requests in a single handler? I'd like to perform an action before a request is executed regardless of their type: </p>
  
  <pre><code>IRequest
  </code></pre>
  
  <p>or </p>
  
  <pre><code>IRequest&lt;Foo&gt;
  </code></pre>
  
  <p>I get what Jimmy says about the PreRequestHandler however I have not been able to implement a single one for all request as they are always typed (I could implement an IPreRequest for every single IRequest I have but that doesn't sound right) ....</p>
  
  <p>Any ideas please?</p>