In my apicontroller, I have a get method that takes in a complex type ModelA, which consist of multiple fields and one of them is a DateTime.
I am passing in date format as "dd/MM/yyyy" but it is picking up as "MM/dd/yyyy"
[HttpGet]
public async Task<IHttpActionResult> MethodA([FromUri]ModelA model)
{
}
public class ModelA
{
public DateTime? FromDate {get;set;}
}
How can I have it to pick up the correct format?
What have I tried:
- overriding ExecuteBindingAsync on HttpParameterBinding and adding parameterBindingRule in HttpConfig
- overriding BindModel on DefaultModel Binder and adding the binder to ModelBinders
both overridden methods did not get called when I call the api