IModelBinder Interface¶
Defines an interface for model binders.
- Namespace
Microsoft.AspNetCore.Mvc.ModelBinding- Assemblies
- Microsoft.AspNetCore.Mvc.Abstractions
Methods¶
-
BindModelAsync(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext)¶ Attempts to bind a model.
Arguments: bindingContext (Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext) – The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.Return type: System.Threading.Tasks.Task Returns: <p> A System.Threading.Tasks.Taskwhich will complete when the model binding process completes. </p> <p> If model binding was successful, theMicrosoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.Resultshould haveMicrosoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.IsModelSetset to <code>true</code>. </p> <p> A model binder that completes successfully should setMicrosoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.Resultto a value returned fromMicrosoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.Success(System.Object). </p>Task BindModelAsync(ModelBindingContext bindingContext)
-