public void DeleteDirector(string directorName) { queue.ChckAndAddToDirectorList(directorName); try { semaphore.WaitAsync(); var indexToDelete = directors.FindIndex(dir => dir.Name.Equals(directorName)); if (indexToDelete == -1) { queue.RemoveDirectorFromQueue(directorName); throw new DataBaseException("No se encontro el director solicitado"); } directors.RemoveAt(indexToDelete); } finally { semaphore.Release(); queue.RemoveDirectorFromQueue(directorName); } }
private void RemoveDirectorAndMovieFromQueue(string movieName, string dirName) { queue.RemoveMovieFromModifyQueue(movieName); queue.RemoveDirectorFromQueue(dirName); }