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); }
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); }
private ReminderTypeConfiguration GetConfiguration(ReminderTypeEnum type) { return(_configurationProvider.GetSettings().Configurations.Single(c => c.Type == type)); }