Share via


CollectionModelBinder<TElement>.CreateOrReplaceCollection Method

Provides a way for derived classes to manipulate the collection before returning it from the binder.

Namespace:  System.Web.Http.ModelBinding.Binders
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Protected Overridable Function CreateOrReplaceCollection ( _
    actionContext As HttpActionContext, _
    bindingContext As ModelBindingContext, _
    newCollection As IList(Of TElement) _
) As Boolean
'Usage
Dim actionContext As HttpActionContext
Dim bindingContext As ModelBindingContext
Dim newCollection As IList(Of TElement)
Dim returnValue As Boolean

returnValue = Me.CreateOrReplaceCollection(actionContext, _
    bindingContext, newCollection)
protected virtual bool CreateOrReplaceCollection(
    HttpActionContext actionContext,
    ModelBindingContext bindingContext,
    IList<TElement> newCollection
)
protected:
virtual bool CreateOrReplaceCollection(
    HttpActionContext^ actionContext, 
    ModelBindingContext^ bindingContext, 
    IList<TElement>^ newCollection
)
abstract CreateOrReplaceCollection : 
        actionContext:HttpActionContext * 
        bindingContext:ModelBindingContext * 
        newCollection:IList<'TElement> -> bool 
override CreateOrReplaceCollection : 
        actionContext:HttpActionContext * 
        bindingContext:ModelBindingContext * 
        newCollection:IList<'TElement> -> bool 
protected function CreateOrReplaceCollection(
    actionContext : HttpActionContext, 
    bindingContext : ModelBindingContext, 
    newCollection : IList<TElement>
) : boolean

Parameters

Return Value

Type: System.Boolean
true in all cases.

See Also

Reference

CollectionModelBinder<TElement> Class

System.Web.Http.ModelBinding.Binders Namespace