zoukankan      html  css  js  c++  java
  • asp.net core mvc ActionFilterAttribute 获取自动定义Attribute

     public class AgreeAuthorizeAttribute : ActionFilterAttribute
        {
            public override void OnActionExecuting(ActionExecutingContext context)
            {
            //转换ActionDescriptor 
            var controllerActionDescriptor = context.ActionDescriptor as ControllerActionDescriptor;
    
            var actionName = controllerActionDescriptor.ActionName;
            var controllerName = controllerActionDescriptor.ControllerName;
    
            var allowAgree = controllerActionDescriptor.MethodInfo
            .GetCustomAttributes(typeof(AnonymousAgreeAttribute), false).FirstOrDefault();
            }
        }
  • 相关阅读:
    python2.7 pip
    opencv
    运维url收集
    转 string和byte[]的转换 (C#)
    Thrift
    Oracle AWR
    并发编程
    LED相关
    java mail 使用 gmail smtp 发送邮件
    jquery动画总结
  • 原文地址:https://www.cnblogs.com/wodemingtian/p/9105190.html
Copyright © 2011-2022 走看看