public voidOnActionExecuting(ActionExecutingContextfilterContext)

中比较方便

有filterContext.ActionParameters,key:value,直接可以获得

但是在其他的

public void OnActionExecuted(ActionExecutedContext filterContext)

 

public void OnAuthorization(AuthorizationContext filterContext)

等等这些参数没有提供ActionParameters

 

filterContext.ActionDescriptor.GetParameters()通过ActionDescriptor可以获得参数名,但是无法获得参数值

参数值可以通过

filterContext.Controller.ValueProvider.GetValue(“??”)

来获得,也不知道这东西性能怎么样

相关文章:

  • 2021-09-07
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2021-06-10
  • 2021-06-11
  • 2022-01-04
  • 2021-09-11
相关资源
相似解决方案