DefaultControllerFactory.GetControllerInstance(RequestContext, Type) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
擷取指定之要求內容和控制器型別的控制器執行個體。
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
實例。