Пример #1
0
        public void Delete(Genre genreToDelete)
        {
            queue.ChckAndAddToGenreList(genreToDelete.Name);
            try
            {
                semaphore.WaitAsync();
                var indexToDelete = genres.FindIndex(gen => gen.Name.Equals(genreToDelete.Name));
                if (indexToDelete == -1)
                {
                    queue.RemoveGenreFromQueue(genreToDelete.Name);
                    throw new DataBaseException("No se encontro el genero solicitado");
                }

                genres.RemoveAt(indexToDelete);
            }
            finally
            {
                semaphore.Release();
                queue.RemoveGenreFromQueue(genreToDelete.Name);
            }
        }
 private void RemoveMovieAndGenreFromQueue(string genreName, string movieName)
 {
     queue.RemoveMovieFromModifyQueue(movieName);
     queue.RemoveGenreFromQueue(genreName);
 }