c# - DateTime format in ASP.NET Web API when passing complex object as a Query string -
i have method in mycontroller derived apicontroller:
public async task myaction([fromuri] mydto input)
mydto class:
public class mydto { public string myprop { get; set; } public datetime mydate { get; set; } }
the request uri http://server/api/myaction?myprop=value&mydate=22/04/2015
so want set parsing format datetime action or controller.
something this:
public class mydto { public string myprop { get; set; } [dateformat("dd/mm/yyyy")] public datetime mydate { get; set; } }
how can achieve this? help!
Comments
Post a Comment