Custom ASP.NET MVC ActionFilterAttribute - hooks never get called

前端 未结 7 522
故里飘歌
故里飘歌 2021-01-01 18:50

Hi I`m trying to do something that seems kinda easy, and is documented that way but for some reason its not going that easy.

Basiclly I wrote something like this:

相关标签:
7条回答
  • 2021-01-01 19:44

    If you see the inheritance of class 'ActionFilterAttribute' that inherits "FilterAttribute, IActionFilter, IResultFilter" classes. The method you are looking is available in IResultFilter interface.

    Therefore it never executes a method when we use custom class as an attribute. Always we need to override all IActionFilter and IResultFilter methods in-terms to custom implementation.

    0 讨论(0)
提交回复
热议问题