过滤器属性的运行顺序
本文关键字:顺序 运行 属性 过滤器 | 更新日期: 2023-09-27 18:28:12
向操作添加诸如OutputCacheAttribute
之类的筛选器属性并覆盖控制器的OnActionExecuting
方法时,哪个先运行?任何地方都有完整MVC生活方式的文档吗?
退房http://bradwilson.typepad.com/blog/2010/07/service-location-pt4-filters.html
总之:动作前过滤器(OnActionExecuting
、OnAuthorization
等)自上而下运行,而动作后过滤器(OnActionExecuted
、OnResultExecuting
等)自下而上运行。