예제 #1
0
        public void AsociateDirectorMovie(Movie movie, Director director)
        {
            lock (asociationLock)
            {
                if (movie.Director.Equals(director))
                {
                    throw new BussinesLogicException("La pelicula ya tiene el director");
                }
                movie.Director = director.Name;
                director.DirectedMovies.Add(movie.Name);

                associationHandler.UpdateMovieDirector(movie, director);
            }
        }
예제 #2
0
        public void AsociateDirectorMovie(Movie movie, Director director)
        {
            try
            {
                semaphore.WaitAsync();
                if (movie.Director.Equals(director))
                {
                    throw new BussinesLogicException("La pelicula ya tiene el director");
                }
                movie.Director = director.Name;
                director.DirectedMovies.Add(movie.Name);

                associationHandler.UpdateMovieDirector(movie, director);
            }
            finally
            {
                semaphore.Release();
            }
        }