public async Task DismissAllOpenAlertsForNotification(int notificationId) { var alerts = await _alertRepository.GetAllOpenAlertsByNotificationId(notificationId); foreach (var alert in alerts) { // notification may have a duplicate alert to be dismissed on multiple other records if (alert is DataQualityPotentialDuplicateAlert duplicateAlert) { await DismissDuplicationAlertsOnDuplicateRecord(notificationId, duplicateAlert.DuplicateId); } SetClosedAndAddClosureDate(alert); } await _alertRepository.SaveAlertChangesAsync(); }