ASP.NET MVC学习(3)过滤器Filter

序言

 

[HttpPost, Route("pushdata"), App_Start.ActionFilter]

 

Global文件中注册RegisterGlobalFilters(GlobalFilters.Filters);

public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
            //注册全局过滤器
            filters.Add(new MessageConsumerHandleErrorAttribute());
        }

 

 

 

资料

http://www.cnblogs.com/yaopengfei/p/7910763.html

public static void RegisterGlobalFilters(GlobalFilterCollection filters)        {            filters.Add(new HandleErrorAttribute());            //注册全局过滤器            filters.Add(new MessageConsumerHandleErrorAttribute());        }

posted @ 2018-06-20 13:51  ~沐风  阅读(178)  评论(0编辑  收藏  举报