Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: The default model binding should allow you to rename properties [167]

$
0
0
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.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>