I have an ASP.NET Web Api 2.2 project where I would like to take the response from all controllers and wrap it in a wrapper object with some metadata. Then I would like my custom Media Type formatter (particularly my custom JsonMediaTypeFormatter) to use that extra metadata to do some custom serialization.
I tried creating a DelegationHandler to do the wrapping, but that happens after the formatter in the pipeline. Is there another way to intercept the response from all controller actions, wrap the response in another object and then have the custom JsonMediaTypeFormatter process it?