Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JsonFormatter"/> class.
 /// </summary>
 /// <param name="options">The configured <see cref="JsonFormatterOptions"/>.</param>
 public JsonFormatter(JsonFormatterOptions options)
 {
     Validator.ThrowIfNull(options, nameof(options));
     Options = options;
     if (options.SynchronizeWithJsonConvert)
     {
         options.Settings.ApplyToDefaultSettings();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JsonFormatter"/> class.
 /// </summary>
 /// <param name="options">The configured <see cref="JsonFormatterOptions"/>.</param>
 public JsonFormatter(JsonFormatterOptions options)
 {
     Validator.ThrowIfNull(options, nameof(options));
     Options = options;
     if (options.SynchronizeWithJsonConvert)
     {
         JsonConvert.DefaultSettings = () => options.Settings;
     }
 }