There doesn't appear to be a way to rename properties in way that is recognized by the default model bindier.
For example, I want this request:
GET api/values?$top=2&$skip=3
to bind to this action:
public IEnumerabe<string> Get(ODataQueryData odataQuery)
With this type:
[FromUri]
public class ODataQueryData
{
[??(Name="$Top")]
public string Top { get; set; }
[??(Name="$Skip")]
public string Skip { get; set; }
[??(Name="$Filter")]
public Filter Filter { get; set; }
}
Comments: You should be able to use [ModelBinder] to rename the properties.
For example, I want this request:
GET api/values?$top=2&$skip=3
to bind to this action:
public IEnumerabe<string> Get(ODataQueryData odataQuery)
With this type:
[FromUri]
public class ODataQueryData
{
[??(Name="$Top")]
public string Top { get; set; }
[??(Name="$Skip")]
public string Skip { get; set; }
[??(Name="$Filter")]
public Filter Filter { get; set; }
}
Comments: You should be able to use [ModelBinder] to rename the properties.