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
Protected Friend Overridable Function GetControllerInstance (requestContext As RequestContext, controllerType As Type) As IController

Parameters

requestContext
RequestContext

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

controllerType
Type

The type of the controller.

Returns

The controller instance.

Exceptions

controllerType is null.

controllerType cannot be assigned.

An instance of controllerType cannot be created.

Applies to