daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var serializerSettings = new JsonSerializerSettings
  2.     {
  3.         DateFormatHandling = DateFormatHandling.IsoDateFormat,
  4.         DateTimeZoneHandling = DateTimeZoneHandling.Utc
  5.     };
  6.  
  7. serializerSettings.Converters.Add(new IsoDateTimeConverter());
  8.  
  9. var jsonFormatter = new JsonMediaTypeFormatter { SerializerSettings = serializerSettings };
  10. jsonFormatter.MediaTypeMappings.Add(GlobalConfiguration.Configuration.Formatters[0].MediaTypeMappings[0]);
  11.  
  12. GlobalConfiguration.Configuration.Formatters[0] = jsonFormatter;
  13.  
  14. WebApiConfig.Register(GlobalConfiguration.Configuration);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top