public virtual void SaveSettings(ExternalNotificationDefinition settings)
        {
            if (settings.Id == 0)
            {
                Logger.Debug("Adding External Notification definition for {0}", settings.Name);
                _database.Insert(settings);
            }

            else
            {
                Logger.Debug("Updating External Notification definition for {0}", settings.Name);
                _database.Update(settings);
            }
        }
        public virtual void InitializeNotifiers(IList<ExternalNotificationBase> notifiers)
        {
            Logger.Debug("Initializing notifiers. Count {0}", notifiers.Count);

            _notifiers = notifiers;

            var currentNotifiers = All();

            foreach (var notificationProvider in notifiers)
            {
                ExternalNotificationBase externalNotificationProviderLocal = notificationProvider;
                if (!currentNotifiers.Exists(c => c.ExternalNotificationProviderType == externalNotificationProviderLocal.GetType().ToString()))
                {
                    var settings = new ExternalNotificationDefinition
                                       {
                                           Enable = false,
                                           ExternalNotificationProviderType = externalNotificationProviderLocal.GetType().ToString(),
                                           Name = externalNotificationProviderLocal.Name
                                       };

                    SaveSettings(settings);
                }
            }
        }