DefaultControllerFactory.GetControllerInstance(RequestContext, 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

参数

requestContext
RequestContext

HTTP 请求的上下文,其中包括 HTTP 上下文和路由数据。

controllerType
Type

控制器的类型。

返回

控制器实例。

例外

controllerType 为 null。

controllerType无法分配 。

无法创建 的 controllerType 实例。

适用于