DefaultControllerFactory.GetControllerInstance(RequestContext, Type) DefaultControllerFactory.GetControllerInstance(RequestContext, Type) Method

Definition

Retrieves the controller instance for the specified request context and controller type.

protected internal virtual System.Web.Mvc.IController GetControllerInstance (System.Web.Routing.RequestContext requestContext, Type controllerType);
abstract member GetControllerInstance : System.Web.Routing.RequestContext * Type -> System.Web.Mvc.IController
override this.GetControllerInstance : System.Web.Routing.RequestContext * Type -> System.Web.Mvc.IController

Parameters

requestContext
RequestContext RequestContext

The context of the HTTP request, which includes the HTTP context and route data.

controllerType
Type Type

The type of the controller.

Returns

The controller instance.

Exceptions

controllerType cannot be assigned.

An instance of controllerType cannot be created.

Applies to