Replace ODataModelBinderProvider globally can cause more problems as it will try to bind all parameters which is not in odata format.<br />More proper fix is to add modelbinder using ModelBinderAttribute on all id parameters. However, we didn’t make binder type public. So a workaround is to create a custom model binder attribute:<br /> public class ODataModelBinderAttribute : ModelBinderAttribute<br /> {<br /> public override System.Web.Http.Controllers.HttpParameterBinding GetBinding(System.Web.Http.Controllers.HttpParameterDescriptor parameter)<br /> {<br /> ODataModelBinderProvider provider = new ODataModelBinderProvider();<br /> return new ModelBinderParameterBinding(<br /> parameter, <br /> provider.GetBinder(parameter.Configuration, parameter.ParameterType),<br /> this.GetValueProviderFactories(parameter.Configuration));<br /> }<br /> }<br /><br />Add this attribute to all ID parameter on all actions in EntitySetController.<br /><br />Without it, user can't support string, guid, long as primary key in odata service.
Comments: Verified
Comments: Verified