Get ActionName, ControllerName and AreaName and pass it in ActionFilter Attribute

前端 未结 5 502
星月不相逢
星月不相逢 2021-01-31 08:34

I use a custom AuthorizationFilter like the followings:

public class ActionAuthorizeAttribute : AuthorizeAttribute {

protected override bool AuthorizeCore(Syste         


        
5条回答
  •  无人共我
    2021-01-31 08:54

    Getting the area will not work if you are on a custom filter the next will work to get an area

    filterContext.RouteData.DataTokens["area"]
    

提交回复
热议问题