DefaultModelBinder.IsModelValid(ModelBindingContext) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定数据模型对指定的绑定上下文是否有效。
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。