Chr*_*old 5 asp.net-mvc attributes
我在MVC应用程序的控制器中使用了2个属性.AttributeA扩展了System.Web.Mvc.AuthorizeAttribute,AttributeB扩展了System.Web.Mvc.ActionFilterAttribute.我希望AttributeB始终先运行.
我已经尝试了基于本文的所有可能的Order组合,但AttributeA 始终在AttributeB之前运行.有人可以帮忙吗?
如果查看System.Web.Mvc.ControllerActionInvoker.InvokeAction
带反射器的方法,您将看到实现IAuthorizationFilter的所有过滤器在从ActionFilterAttribute派生的属性之前被调用,因为在调用操作之前进行了授权.
归档时间: |
|
查看次数: |
553 次 |
最近记录: |