Compartilhar via


Controller.Binders Property

Gets or sets the binder.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

'Declaration
Protected Friend Property Binders As ModelBinderDictionary
    Get
    Set
protected internal ModelBinderDictionary Binders { get; set; }
protected public:
property ModelBinderDictionary^ Binders {
    ModelBinderDictionary^ get ();
    void set (ModelBinderDictionary^ value);
}

Property Value

Type: System.Web.Mvc.ModelBinderDictionary
The binder.

Remarks

The setter for this property supports unit-testing scenarios and is not intended to be called from user code. This property is provided so that you can create unit tests for form-post scenarios that call the [Overload:System.Web.Mvc.Controller.TryUpdateModel``1] and [Overload:System.Web.Mvc.Controller.UpdateModel``1] methods. If you are testing the [Overload:System.Web.Mvc.Controller.TryUpdateModel``1] and [Overload:System.Web.Mvc.Controller.UpdateModel``1] methods, you can set the Binders property to a mock version of the ModelBinderDictionary object instead of testing the global Binders collection.

See Also

Reference

Controller Class

System.Web.Mvc Namespace