I need to know how to create a custom IModelBinder
in MVC 4 and it has been changed.
The new method that has to be implemented is :
bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext);
There are 2 IModelBinder interfaces:
System.Web.Mvc.IModelBinder
which is the same as in previous versions and hasn't changedSystem.Web.Http.ModelBinding.IModelBinder
which is used by the Web API and the ApiController. So basically inside this method you must set the actionContext.ActionArguments
to the corresponding values. You no longer return a model instance.