Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
那么如何/在我的 MVC4 应用程序中注册一个 IControllerActivator 实例以便将其提供给 DefaultControllerFactory?
您只需要将它作为参数传递给ControllerFactory.
ControllerFactory
例如:
IControllerActivator myHomeMadeControllerActivator = new MyHomeMadeControllerActivator();
然后:
ControllerBuilder.Current.SetControllerFactory(new DefaultControllerFactory(myOwnControllerActivator));