Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var serializerSettings = new JsonSerializerSettings
- {
- DateFormatHandling = DateFormatHandling.IsoDateFormat,
- DateTimeZoneHandling = DateTimeZoneHandling.Utc
- };
- serializerSettings.Converters.Add(new IsoDateTimeConverter());
- var jsonFormatter = new JsonMediaTypeFormatter { SerializerSettings = serializerSettings };
- jsonFormatter.MediaTypeMappings.Add(GlobalConfiguration.Configuration.Formatters[0].MediaTypeMappings[0]);
- GlobalConfiguration.Configuration.Formatters[0] = jsonFormatter;
- WebApiConfig.Register(GlobalConfiguration.Configuration);
Add Comment
Please, Sign In to add comment