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
-
CollectionModelBinder<TElement>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
HttpActionContextThe action context.
bindingContext
ModelBindingContextThe 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
HttpActionContextThe action context.
bindingContext
ModelBindingContextThe binding context.
newCollection
IList<TElement>The new collection.
Returns
- bool
true in all cases.