CollectionModelBinder<TElement>.AddErrorIfBindingRequired Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Add a ModelError to ModelState if IsBindingRequired.
protected:
void AddErrorIfBindingRequired(Microsoft::AspNetCore::Mvc::ModelBinding::ModelBindingContext ^ bindingContext);
protected void AddErrorIfBindingRequired (Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext bindingContext);
member this.AddErrorIfBindingRequired : Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext -> unit
Protected Sub AddErrorIfBindingRequired (bindingContext As ModelBindingContext)
Parameters
- bindingContext
- ModelBindingContext
The ModelBindingContext.
Remarks
For back-compatibility reasons, Result must have IsModelSet equal to true
when a top-level model is not bound. Therefore, ParameterBinder can not detect a IsBindingRequired failure for collections. Add the error here.