/// <summary> /// Initializes a new instance of the <see cref="NewtonsoftJsonSerializer"/> class. /// </summary> /// <param name="stringEncoder">string encoder</param> /// <param name="settings">serializer settings</param> public NewtonsoftJsonSerializer(Encoding stringEncoder, JsonSerializerSettings?settings) { this.Encoding = stringEncoder; if (settings == null) { var s = new JsonSerializerSettings(); JsonHelper.AddCommonConverters(s); this.serializer = JsonSerializer.Create(s); } else { this.serializer = JsonSerializer.Create(settings); } }