public void Write(string eventName, Dictionary <string, string> data)
        {
            Guard.AgainstNullOrEmpty(() => eventName, eventName);

            var subscriptions = SubscriptionCache.GetAll(eventName);
            var results       = new List <SubscriptionDeliveryResult>();

            subscriptions.ForEach(sub =>
            {
                var result = NotifySubscription(sub, eventName, data);
                if (result != null)
                {
                    results.Add(result);
                }
            });

            if (results.Any())
            {
                SubscriptionService.UpdateResults(results);
            }
        }
        public void Write(WebhookEvent webhookEvent)
        {
            Guard.AgainstNull(() => webhookEvent, webhookEvent);

            var subscriptions = SubscriptionCache.GetAll(webhookEvent.EventName);
            var results       = new List <SubscriptionDeliveryResult>();

            subscriptions.ForEach(sub =>
            {
                var result = NotifySubscription(sub, webhookEvent);
                if (result != null)
                {
                    results.Add(result);
                }
            });

            if (results.Any())
            {
                SubscriptionService.UpdateResults(results);
            }
        }