【问题标题】:Controller Class without Controller at the end of the name?名称末尾没有控制器的控制器类?
【发布时间】:2017-06-15 21:57:35
【问题描述】:

出于对问题不重要的原因,如果我的控制器类名不以 @987654323 结尾,我想知道如何使我的控制器/路由在 ASP.NET MVC5 中工作@按照惯例?我需要在某处手动注册吗?

【问题讨论】:

标签: asp.net asp.net-mvc asp.net-mvc-5 asp.net-mvc-routing url-routing


【解决方案1】:

Controller 后缀被烘焙到 ControllerDescriptorControllerTypeCache 类中,使其难以覆盖。想到的一种方法是编写自定义控制器工厂并覆盖GetControllerType 方法。

【讨论】:

    猜你喜欢
    • 2014-05-23
    • 2019-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-05
    • 1970-01-01
    相关资源
    最近更新 更多