I am on a project that needs to have a cross-cutting error handling and response manipulation. I found there are Filters And Delegating Handlers, but I don't know the difference between these two, can someone help me please to figure this out?
Asked
Active
Viewed 261 times
1 Answers
1
There is some info around this in SO such as
When to use HttpMessageHandler vs ActionFilter?
simply put:
- message handler comes earlier than filters - so can circuit out earlier
- message handler is more generic - process HTTP request
- filter on other hand are only applicable in Actions, hence more specific
so base on the characteristics and what you want, you choose which one fit the most
there is a stack diagram of the flow
source from: https://blogs.msdn.microsoft.com/kiranchalla/2012/05/05/asp-net-mvc4-web-api-stack-diagram/

Alan Tsai
- 2,465
- 1
- 13
- 16