开发者

how do I get ActionDescriptor from either ActionExecutingContext or AuthorizationContext?

I'm writing a method that just uses the ActionDescriptor property but I can't figure out how to avoid repeating the body of the method so that it can take either an ActionExecutingContext or an AuthorizationContext. Both of these types have an ActionDescriptor property, but they don't inherit it from a common type or interfac开发者_StackOverflowe that I can find.


Refactor the code that consumes the ActionDescriptor into its own static method somewhere, then call that method from within your OnActionExecuting() or OnAuthorization(), passing in the ActionDescriptor object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜