예제 #1
0
        public static void ReplaceTriggerInfo(SimpleTriggerModel triggerToReplace)
        {
            var localTrigger = _triggersInfo.First(x => x.DateStart == triggerToReplace.DateStart && x.RepeatType == triggerToReplace.RepeatType);
            var index        = _triggersInfo.IndexOf(localTrigger);

            _triggersInfo[index].ConsumerNotificationSettingIds = triggerToReplace.ConsumerNotificationSettingIds;
        }
예제 #2
0
        private static int FindAndCompare(SimpleTriggerModel trigger)
        {
            var localTrigger = _triggersInfo.FirstOrDefault(x => trigger.DateStart == x.DateStart && trigger.RepeatType == x.RepeatType);

            if (localTrigger is null)
            {
                return(-1);
            }
            if (trigger.ConsumerNotificationSettingIds.Count != localTrigger.ConsumerNotificationSettingIds.Count)
            {
                return(0);
            }
            var diff = localTrigger.ConsumerNotificationSettingIds.Except(trigger.ConsumerNotificationSettingIds);

            return(diff.Any() ? 0 : 1);
        }
예제 #3
0
 public static long GetTriggerId(SimpleTriggerModel notification) =>
 _triggersInfo.First(x => x.DateStart == notification.DateStart && x.RepeatType == notification.RepeatType).TriggerId;