Share via


DefaultModelBinder.IsModelValid(ModelBindingContext) 方法

定义

确定数据模型对指定的绑定上下文是否有效。

protected static bool IsModelValid (System.Web.Mvc.ModelBindingContext bindingContext);
static member IsModelValid : System.Web.Mvc.ModelBindingContext -> bool
Protected Shared Function IsModelValid (bindingContext As ModelBindingContext) As Boolean

参数

bindingContext
ModelBindingContext

绑定模型的上下文。 上下文包含模型对象、模型名称、模型类型、属性筛选器和值提供程序等信息。

返回

如果模型有效,则为 true;否则为 false。

例外

bindingContext 参数为 null。

适用于