Table of Contents

Class DictionaryModelBinder<TKey, TValue>

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

Maps a browser request to a dictionary data object.

public class DictionaryModelBinder<TKey, TValue> : CollectionModelBinder<KeyValuePair<TKey, TValue>>, IModelBinder

Type Parameters

TKey

The type of the key.

TValue

The type of the value.

Inheritance
DictionaryModelBinder<TKey, TValue>
Implements
Inherited Members

Constructors

DictionaryModelBinder()

Initializes a new instance of the DictionaryModelBinder<TKey, TValue> class.

public DictionaryModelBinder()

Methods

CreateOrReplaceCollection(HttpActionContext, ModelBindingContext, IList<KeyValuePair<TKey, TValue>>)

Converts the collection to a dictionary.

protected override bool CreateOrReplaceCollection(HttpActionContext actionContext, ModelBindingContext bindingContext, IList<KeyValuePair<TKey, TValue>> newCollection)

Parameters

actionContext HttpActionContext

The action context.

bindingContext ModelBindingContext

The binding context.

newCollection IList<KeyValuePair<TKey, TValue>>

The new collection.

Returns

bool

true in all cases.