public LocalWebHookProcessor(IWebHookSubscriptionStore subscriptionStore, IWebHookClient webHookClient, IOptions <ClientStoreOptions> clientStoreOptions, ILogger <LocalWebHookProcessor> logger) { _subscriptionStore = subscriptionStore; _webHookClient = webHookClient; _logger = logger; _clientStoreOptions = clientStoreOptions?.Value ?? new ClientStoreOptions(); }
public override void ActivateOptions() { base.ActivateOptions(); if (string.IsNullOrEmpty(WebHookUrl)) { throw new LogException($"{nameof(WebHookUrl)} must not be empty or null."); } if (SerializerType == null) { throw new LogException($"{nameof(SerializerType)} must not be empty or null."); } var serializer = Activator.CreateInstance(SerializerType) as IJsonHttpContentConverter; if (serializer == null) { throw new LogException($"{nameof(SerializerType)} must implements {typeof(IJsonHttpContentConverter).FullName}."); } _client = new WebHookClient(serializer); }