void IMemberSearchAlertsCommand.AddResults(Guid employerId, IList <SavedResumeSearchAlertResult> results) { //Get the employer's unviewed candidates var unviewedCandidates = _repository.GetUnviewedCandidates(employerId); var resultsToSave = new List <SavedResumeSearchAlertResult>(); foreach (var result in results) { if (unviewedCandidates.Select(r => r.CandidateId).Contains(result.CandidateId)) { continue; } result.Prepare(); resultsToSave.Add(result); } _repository.AddResults(resultsToSave); }
IList <SavedResumeSearchAlertResult> IMemberSearchAlertsQuery.GetUnviewedCandidates(Guid ownerId) { return(_repository.GetUnviewedCandidates(ownerId)); }