asp.net core的授权过滤器中获取action上的Attribute

var action = context.ActionDescriptor as ControllerActionDescriptor;
var permission = action.MethodInfo.GetCustomAttribute<PermissionAttribute>();

大概就是这样。

posted on 2019-11-05 14:28  快乐海盗  阅读(1678)  评论(0编辑  收藏  举报