I need to return a consistent response with a similar structure returned for all requests. In the previous .NET web api, I was able to achieve this using DelegatingHandler (
For those looking for a modern solution, you can now use AutoWrapper for this.
It's very easy to use; just add the following to your Startup.cs file:
Startup.cs
app.UseApiResponseAndExceptionWrapper();