Table of Contents

Class ArrayModelBinder<TElement>

Namespace
System.Web.Http.ModelBinding.Binders
Assembly
System.Web.Http.dll

Maps a browser request to an array.

public class ArrayModelBinder<TElement> : CollectionModelBinder<TElement>, IModelBinder

Type Parameters

TElement

The type of the array.

Inheritance
ArrayModelBinder<TElement>
Implements
Inherited Members

Constructors

ArrayModelBinder()

Initializes a new instance of the ArrayModelBinder<TElement> class.

public ArrayModelBinder()

Methods

BindModel(HttpActionContext, ModelBindingContext)

Indicates whether the model is binded.

public override bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)

Parameters

actionContext HttpActionContext

The action context.

bindingContext ModelBindingContext

The binding context.

Returns

bool

true if the specified model is binded; otherwise, false.

CreateOrReplaceCollection(HttpActionContext, ModelBindingContext, IList<TElement>)

Converts the collection to an array.

protected override bool CreateOrReplaceCollection(HttpActionContext actionContext, ModelBindingContext bindingContext, IList<TElement> newCollection)

Parameters

actionContext HttpActionContext

The action context.

bindingContext ModelBindingContext

The binding context.

newCollection IList<TElement>

The new collection.

Returns

bool

true in all cases.