控制器动作调用者

发布于 2024-07-16 15:25:47 字数 36 浏览 8 评论 0原文

ControllerActionInvoker类有什么用?

What is the use of ControllerActionInvoker class?

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

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

发布评论

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

评论(1

丑疤怪 2024-07-23 15:25:47

基本上,它是控制器类上的一个扩展点,允许您进入那里并影响控制器与参数、过滤器和操作本身的交互方式。 当请求被路由到控制器时,控制器要求 ControllerActionInvoker 处理该请求(这通常涉及调用控制器上的方法)。

到目前为止,我看到的主要用途是向操作过滤器提供依赖项注入,如下所示 此处,但我相信我们将来会看到此功能的更多用途!

Basically it's an extensibility point on a Controller class that allows you to get in there and influence how the controller interacts with Parameters, Filters and the Action itself. When a request has been routed to the Controller, the Controller asks the ControllerActionInvoker to deal with the request (which normally involves it calling a method back on the Controller).

The main usage of this I've seen so far is to provide dependency injection into Action Filters as shown here, but I'm sure we'll see more uses for this feature popping up in the future!

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