We have several API controllers that accept GET requests as follows:
public IHttpActionResult Get([FromUri]Foo f);
public IHttpActionResult Get([FromUri]Bar b);
Now - we would like (or, forcibly) change the format of the DateTime string in the GET request string globally
"yyyy-MM-ddTHH:mm:ss" -> "yyyy-MM-ddTHH.mm.ss"
After the change, all serializations [FromUri]with classes containing types DateTimefail.
Is there a way to complement serialization [FromUri]to accept the DateTime format in the query string? Or do we need to create custom serialization for all API parameters to support the new DateTime string format?
EDIT : example on request
public class Foo {
public DateTime time {get; set;}
}
public IHttpActionResult Get([FromUri]Foo f);
GET api/foo?time=2017-01-01T12.00.00