Export (0) Print
Expand All

DefaultControllerFactory Constructor (IControllerActivator)

Initializes a new instance of the DefaultControllerFactory class using a controller activator.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public DefaultControllerFactory(
	IControllerActivator controllerActivator
)

Parameters

controllerActivator
Type: System.Web.Mvc.IControllerActivator

An object that implements the controller activator interface.

This constructor provides more fine-grained control over how controllers are instantiated using dependency injection.

Controller activators do not implement GetType. They are responsible only for initializing an instance of a controller type. The controller factory is responsible for providing type information. When using this constructor, controller factories should delegate to an object that implements IControllerActivator to handle the instantiation of the controller.

Show:
© 2014 Microsoft