void IMemberSearchAlertsCommand.UpdateMemberSearch(IUser owner, MemberSearch search, params Tuple <AlertType, bool>[] alertMethods) { // Update the search. _memberSearchesCommand.UpdateMemberSearch(owner, search); // Check whether each alert already exists. foreach (var method in alertMethods) { var alertType = method.Item1; var alert = _repository.GetMemberSearchAlert(search.Id, alertType); if (method.Item2) { if (alert == null) { CreateMemberSearchAlert(search, alertType); } } else { if (alert != null) { DeleteMemberSearchAlert(search, alertType); } } } }
MemberSearchAlert IMemberSearchAlertsQuery.GetMemberSearchAlert(Guid searchId, AlertType alertType) { return(_repository.GetMemberSearchAlert(searchId, alertType)); }