我看到在一种情况下,我们可以覆盖继承自ActionFilterattribute类的OnActionExecuting或OnActionExecuted方法,如下所示:
public class MyFilterattribute : ActionFilterattribute { public override void OnActionExecuted(ActionExecutedContext filterContext) { // bla bla } }
而在其他情况下,我们也可以这样实现IActionFilter和Filterattribute:
public class MySecondFilterattribute : Filterattribute,IActionFilter { public void OnActionExecuted(ActionExecutingContext filterContext) {} }
那么这两种方法之间是否存在差异,也许任何特别的情况下,优先使用其中之一呢?
提前致谢。
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。