Delen via


ArrayModelBinder<TElement> Class

Definition

IModelBinder implementation for binding array values.

generic <typename TElement>
public ref class ArrayModelBinder : Microsoft::AspNetCore::Mvc::ModelBinding::Binders::CollectionModelBinder<TElement>
public class ArrayModelBinder<TElement> : Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<TElement>
type ArrayModelBinder<'Element> = class
    inherit CollectionModelBinder<'Element>
Public Class ArrayModelBinder(Of TElement)
Inherits CollectionModelBinder(Of TElement)

Type Parameters

TElement

Type of elements in the array.

Inheritance
ArrayModelBinder<TElement>

Constructors

ArrayModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean, MvcOptions)

Creates a new ArrayModelBinder<TElement>.

ArrayModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

Creates a new ArrayModelBinder<TElement>.

ArrayModelBinder<TElement>(IModelBinder, ILoggerFactory)

Creates a new ArrayModelBinder<TElement>.

ArrayModelBinder<TElement>(IModelBinder)
Obsolete.

This constructor is obsolete and will be removed in a future version. The recommended alternative is the overload that also takes an ILoggerFactory.

Creates a new ArrayModelBinder<TElement>.

Properties

ElementBinder

Gets the IModelBinder instances for binding collection elements.

(Inherited from CollectionModelBinder<TElement>)
Logger

The ILogger used for logging in this binder.

(Inherited from CollectionModelBinder<TElement>)

Methods

AddErrorIfBindingRequired(ModelBindingContext)

Add a ModelError to ModelState if IsBindingRequired.

(Inherited from CollectionModelBinder<TElement>)
BindModelAsync(ModelBindingContext)

Attempts to bind a model.

(Inherited from CollectionModelBinder<TElement>)
CanCreateInstance(Type) System.Object.CanCreateInstance(System.Type)
ConvertToCollectionType(Type, IEnumerable<TElement>)

Gets an Object assignable to targetType that contains members from collection.

CopyToModel(Object, IEnumerable<TElement>)

Adds values from sourceCollection to given target.

CreateEmptyCollection(Type)

Create an Object assignable to targetType.

CreateInstance(Type)

Create an instance of targetType.

(Inherited from CollectionModelBinder<TElement>)

Applies to