How do you format a (c# web api 2 framework 4.5) DateTime to an iso string to send across the wire for a js front end? I need to do this globally. Should the date from the db be stored as a string in c#, or is DateTime ok. I can do this locally, but want to apply the settings across the solution to avoid peppering my code with:JsonSerializerSettings microsoftDateFormatSettings = new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.IsoDateFormat }; stringJson = JsonConvert.SerializeObject(myModel, new JavaScriptDateTimeConverter());
mardi 22 novembre 2016
How to format datetime in ISO globally in web api 2?
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire