How to add global Filter in Asp.net core mvc

In mvc5, we can use GlobalFilterCollection to add global Filter;

But when asp.net core mvc, how do we add a global Filter?

as follows:

[csharp]  view plain copy  
  1. services.AddMvc(cfg =>  
  2. {  
  3.      cfg.Filters.Add(new RightFilter());  
  4. });  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324885690&siteId=291194637