Example #1
0
        public void CreateIfNotExists(Guid activityId, ReminderTypeEnum type)
        {
            if (_reminderRepository.Exists(r => r.ActivityId == activityId && r.Type == type))
            {
                return;
            }

            var entity = new Notification.Sql.Reminder
            {
                Id         = Guid.NewGuid(),
                ActivityId = activityId,
                Type       = type
            };

            _reminderRepository.Add(entity);
        }
Example #2
0
        public Reminder CreateIfNotExists(Guid activityId, ReminderTypeEnum type)
        {
            if (_remindeRepository.Exists(r => r.ActivityId == activityId && r.Type == type && !r.IsDelivered))
            {
                return(null);
            }

            var entity = new Reminder
            {
                Id         = Guid.NewGuid(),
                ActivityId = activityId,
                Type       = type
            };

            _remindeRepository.Add(entity);
            return(entity);
        }
Example #3
0
 private ReminderTypeConfiguration GetConfiguration(ReminderTypeEnum type)
 {
     return(_configurationProvider.GetSettings().Configurations.Single(c => c.Type == type));
 }