Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="cdmdotnet Limited">
4 : // // Copyright cdmdotnet Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System.Collections.Generic;
10 : using Newtonsoft.Json;
11 : using Newtonsoft.Json.Converters;
12 :
13 : namespace Cqrs.Events
14 : {
15 : public class DefaultJsonSerializerSettings
16 0 : {
17 : public static JsonSerializerSettings DefaultSettings { get; private set; }
18 :
19 : static DefaultJsonSerializerSettings()
20 : {
21 : DefaultSettings = new JsonSerializerSettings
22 : {
23 : Formatting = Formatting.None,
24 : MissingMemberHandling = MissingMemberHandling.Ignore,
25 : DateParseHandling = DateParseHandling.DateTimeOffset,
26 : DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind,
27 : Converters = new List<JsonConverter> { new StringEnumConverter() },
28 : DateFormatHandling = DateFormatHandling.IsoDateFormat,
29 : DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
30 : FloatFormatHandling = FloatFormatHandling.DefaultValue,
31 : NullValueHandling = NullValueHandling.Include,
32 : PreserveReferencesHandling = PreserveReferencesHandling.All,
33 : ReferenceLoopHandling = ReferenceLoopHandling.Error,
34 : StringEscapeHandling = StringEscapeHandling.EscapeNonAscii,
35 : TypeNameHandling = TypeNameHandling.All
36 : };
37 : }
38 : }
39 : }
|