protected BaseJsonMediaTypeFormatter(BaseJsonMediaTypeFormatter formatter) : base(formatter) { Contract.Assert(formatter != null); SerializerSettings = formatter.SerializerSettings; #if !NETFX_CORE // MaxDepth is not supported in portable library and so _maxDepth never changes there MaxDepth = formatter._maxDepth; #endif }
private static void ConfigureJson(BaseJsonMediaTypeFormatter jsonFormatter) { jsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html")); jsonFormatter.SerializerSettings.Formatting = Formatting.Indented; jsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Include; jsonFormatter.SerializerSettings.DateFormatHandling = DateFormatHandling.IsoDateFormat; jsonFormatter.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc; jsonFormatter.SerializerSettings.Culture = CultureInfo.InvariantCulture; }
protected BaseJsonMediaTypeFormatter(BaseJsonMediaTypeFormatter formatter) : base(formatter) { Contract.Assert(formatter != null); SerializerSettings = formatter.SerializerSettings; #if !NETFX_CORE // MaxDepth is not supported in portable library and so _maxDepth never changes there MaxDepth = formatter._maxDepth; #endif }