Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WebHookSender"/> class.
        /// </summary>
        protected WebHookSender(ILogger <WebHookSender> logger, IOptions <WebHookSettings> settings)
        {
            _logger   = logger ?? throw new ArgumentNullException(nameof(logger));
            _settings = settings.Value;

            _serializer = _settings.Settings != null?JsonSerializer.Create(_settings.Settings) : JsonSerializer.CreateDefault();

            _serializer.Converters.Add(new NotificationDictionarySerializer());
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebHookSender"/> class.
 /// </summary>
 protected WebHookSender(ILogger <WebHookSender> logger, IOptions <WebHookSettings> settings)
 {
     _logger   = logger ?? throw new ArgumentNullException(nameof(logger));
     _settings = settings.Value;
 }