转载:Stack Overflow问题 When to use HttpMessageHandler vs ActionFilter?

The major difference between their two is their focus. Message Handlers are applied to all HTTP requests. They perform the function of an HTTP intermediary. Filters apply only to requests that are dispatched to the particular controller/action where the filter is applied.

You should use MessageHandlers when you want the behaviour to be applied to the vast majority of requests. Filters should be used when they are only applicable to certain resources.

[ASP.NET Web API] Message Handler与Filter的区别

 

相关文章:

  • 2022-01-13
  • 2022-12-23
  • 2021-07-27
  • 2021-09-11
  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-12-25
  • 2021-12-10
  • 2021-11-12
  • 2021-04-22
相关资源
相似解决方案