I have a custom databinder for a specific data type and everything is working flawlessly. However I want to know if it is possible to change the binding context and call the BindModel for another type and not that one being bound.
For an example:
public class CustomModelBinder : DefaultModelBinder
{
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var otherTypeObject = BindModel(controllerContext, [other-binding-context]);
return wizard;
}
Yes, it is possible, just create another binding context with your configuration:
And then you call the
base.BindModelusing the context above.