我怎样才能获得动作名称?

发布于 2024-09-12 04:15:35 字数 355 浏览 1 评论 0原文

我用 WindsorControllerFactory 替换了 ASP.NET ControllerFactory。

我注册了所有控制器和拦截器。直到这里一切都运转良好。

现在,当我调试拦截器时,我总是在 incalling.Method.Name 中从 ControllerBase 获得执行。我需要获取操作名称和操作参数来进行一些验证。

如何在拦截器的 Intercept 方法中获取操作名称和操作参数? ControllerBase_Execute 方法及其参数的信息对我没有帮助。

谢谢,

拉斐尔·莫勒西姆

I replaced the ASP.NET ControllerFactory by a WindsorControllerFactory.

And I registered all controllers and interceptors. Until here everything working well.

Now when I am debuging my Interceptor I always get Execute from ControllerBase in invocation.Method.Name. I need to get the action name and the parameters of the action to do some validations.

How can I get the action name and the action parameters in the Intercept method of my Interceptor? The information of ControllerBase_Execute method and his parameters don't help me.

Thanks,

Raphael Molesim

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

上课铃就是安魂曲 2024-09-19 04:15:35

我相信您可以从 RequestContext.RouteData 集合中获取它。我认为方法/动作的关键是“动作”。像这样的东西:

requestContext.RouteData.Values["action"]

I believe you can get that from the RequestContext.RouteData collection. I think the keys for the method/action is "action". Something like:

requestContext.RouteData.Values["action"]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文