Filter生命周期
在 FourthController 控制器新建 Index5 方法,在对应的过滤器中设置断点。
[Authorize(AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme, Policy = "rolePolicy")]
[CustomCacheResourceFilter]
[TypeFilter(typeof(CustomLogActionFilterAttribute))]
[TypeFilter(typeof(CustomResultFilterAttribute))]
[TypeFilter(typeof(CustomAlwaysRunResultFilterAttribute))]
[TypeFilter(typeof(CustomExceptionFilterAttribute))]
public IActionResult Index5()
{
return View();
}
参考之前关于过滤器的文章:
https://blog.csdn.net/nmmking/article/details/139025585