0

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?

Nasir Jafarzadeh
  • 6,123
  • 1
  • 13
  • 19

1 Answers1

1

There is some info around this in SO such as

When to use HttpMessageHandler vs ActionFilter?

simply put:

  1. message handler comes earlier than filters - so can circuit out earlier
  2. message handler is more generic - process HTTP request
  3. 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 ASP.NET MVC4 Web API Stack Diagram

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