Having a CustomModelBinder
was the solution. As i didn't need complete case insensitivity, I only check if the lowercase version of my property is found.
public class CustomModelBinder : DefaultModelBinder
{
protected override void SetProperty(ControllerContext controllerContext,
ModelBindingContext bindingContext,
PropertyDescriptor propertyDescriptor,
object value)
{
//only needed if the case was different, in which case value == null
if (value == null)
{
// this does not completely solve the problem,
// but was sufficient in my case
value = bindingContext.ValueProvider.GetValue(
bindingContext.ModelName + propertyDescriptor.Name.ToLower());
var vpr = value as ValueProviderResult;
if (vpr != null)
{
value = vpr.ConvertTo(propertyDescriptor.PropertyType);
}
}
base.SetProperty(controllerContext, bindingContext, propertyDescriptor, value);
}
}
DefaultModelBinder
was case-intensive already? Can you show the code where it seems case-sensitive. – Maziemazlack