【发布时间】:2014-01-16 13:37:06
【问题描述】:
如您所知,MVC 和 Web api 操作过滤器对其过滤器使用不同的命名空间:
在网络 api 中:
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
HttpActionExecutedContext 在system.web.http.filters
在 MVC 中:
public override void OnActionExecuted(ActionExecutedContext actionExecutedContext)
ActionExecutedContext 在system.web.mvc
我想在 web api 或 MVC 时为我的所有控制器设置一个过滤器。
那么我该如何解决这个问题呢?
【问题讨论】:
标签: asp.net-mvc asp.net-web-api action-filter