I have API controller that has one Put method
public class ScheduleExecutionsController : ApiController
{
public ScheduleExecutionsResponse Put([ModelBinder(typeof(TestBinder))]ScheduleExecutionsRequest requestInfo)
{
....
}
}
I added a binder class to the project
public class TestBinder : IModelBinder
{
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
return new ScheduleExecutionsRequest();
}
}
I set 2 breakpoints. First one to the first line of Put method in controller and second to first line of my TestBinder BindModel object. After with Fiddler I send PUT request.
Debugger stops always inside my action but never inside BindModel methof of the binder. It seems that default binder is used. What did I miss to add custom one?