DefaultModelBinder.CreateModel 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的控制器上下文和绑定上下文来创建指定的模型类型。
protected virtual object CreateModel (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext, Type modelType);
abstract member CreateModel : System.Web.Mvc.ControllerContext * System.Web.Mvc.ModelBindingContext * Type -> obj
override this.CreateModel : System.Web.Mvc.ControllerContext * System.Web.Mvc.ModelBindingContext * Type -> obj
Protected Overridable Function CreateModel (controllerContext As ControllerContext, bindingContext As ModelBindingContext, modelType As Type) As Object
参数
- controllerContext
- ControllerContext
运行控制器的上下文。 上下文信息包括控制器、HTTP 内容、请求上下文和路由数据。
- bindingContext
- ModelBindingContext
绑定模型的上下文。 上下文包含模型对象、模型名称、模型类型、属性筛选器和值提供程序等信息。
- modelType
- Type
要返回的模型对象的类型。
返回
指定类型的数据对象。