Udostępnij przez


CollectionModelBinder<TElement>.AddErrorIfBindingRequired Metoda

Definicja

Dodaj element ModelError do ModelState elementu 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)

Parametry

bindingContext
ModelBindingContext

Element ModelBindingContext.

Uwagi

Ze względów zgodności z zapleczem musi mieć IsModelSet wartość równątrue, Result gdy model najwyższego poziomu nie jest powiązany. W związku z tym parametrBinder nie może wykryć błędu IsBindingRequired dla kolekcji. Dodaj tutaj błąd.

Dotyczy