分类:
.net core
通过设置order即可。
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
services.AddMvc(a =>
{
//全局注入筛选器
//a.Filters.Add(new TestActionFilter());
//a.Filters.Add(new MySampleActionFilter());
a.Filters.Add(typeof(TestActionFilter), 10);
a.Filters.Add(typeof(MySampleActionFilter), 1);
});
}
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739
评价