Is it possible to map parameters from request to properties with different names? I need it because I'd like to use words splitted by underscore as url parameters but in C# code I'd like to use normal convention. Example :
?property_name=1 to property PropertyName
In the request I use [FromUri]
parameter like
public IHttpActionResult DoMethod([FromUri(Name = "")] SomeInput input)
Initially I thought that model binding is performed by Json serializer but probably it isn't. I tried DataMember attribute as well but these approaches do not work.
public class SomeInput
{
[JsonProperty("property_name")]
[DataMember(Name = "property_name")]
public int PropertyName { get; set; }
}
I read about the custom binders but I hope some more simple way must exist. Any idea how to do this correctly and simple in ASP.NET Web API 2 with using Owin and Katana?