Something like this should work:<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 />And in action, use it like:<br />public virtual HttpResponseMessage GetById([ODataModelBinder]TKey key)<br /><br />We should update EntitySetController to use that attribute.
↧
Edited Issue: Need ODataModelBinderAttribute to make it easy to apply the binder to parameters [658]
↧