net core 忽略过滤器

/// summary/// 排除Token检测Filter/// /summary[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]public class ExcludeTokenFilterAttribute : A...

    /// <summary>
    /// 排除Token检测Filter
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
    public class ExcludeTokenFilterAttribute : Attribute
    {
    }
var actionDescriptor = context.ActionDescriptor as ControllerActionDescriptor;
            //是否存在ExcludeToken特性 0-否   1-是
            var excludeTokenAttr = actionDescriptor.EndpointMetadata.OfType<ExcludeTokenFilterAttribute>().Count();
            if (excludeTokenAttr == 0) 
            {
       }

 

本文标题为:net core 忽略过滤器

基础教程推荐