Esempio n. 1
0
        public Movie GetMovie(int idActor, int idMovie)
        {
            validateActor(idActor);
            var movieRepo = cineRepository.GetMovie(idMovie);

            if (movieRepo == null)
            {
                throw new NotFoundEx($"There isn't a movie with id:{idMovie}");
            }
            if (idActor != movieRepo.ActorId)
            {
                throw new BadRequestEx($"Movie: {idMovie} doesn't belong to Actor: {idActor}");
            }
            return(movieRepo);
        }