博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
asp.net core mvc ActionFilterAttribute 获取自动定义Attribute
阅读量:6959 次
发布时间:2019-06-27

本文共 629 字,大约阅读时间需要 2 分钟。

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();        }    }

 

转载于:https://www.cnblogs.com/wodemingtian/p/9105190.html

你可能感兴趣的文章
bzoj 4373 算术天才⑨与等差数列——线段树+set
查看>>
Yii学习系列:Yii视频讲义——前篇(转)
查看>>
【转】 数据库备份与还原处理
查看>>
get application power
查看>>
Ubuntu14.04+RabbitMQ3.6.3+Golang的最佳实践
查看>>
移动端开发经验小结
查看>>
浅谈CLR
查看>>
C# parser JSON get Key and value
查看>>
关于log4net
查看>>
http 协议里的 200、301、302、401、403、405、500 分别代表什么?
查看>>
时代亿信 终端安全登录产品
查看>>
存储字节kb,mb,gb,tb转换代码
查看>>
Spiral Matrix I II
查看>>
vue全家桶+Koa2开发笔记(7)--登陆注册功能
查看>>
远程调试js注意事项
查看>>
第一个微信小项目
查看>>
OpenGL Windows 窗口程序环境搭建
查看>>
OpenCV 透视变换实例
查看>>
hdu1251(Trie树)
查看>>
VS2010中的sln,suo分别是什么文件
查看>>