Ejemplo n.º 1
0
        public async Task <ActionResult <MovieDto> > AddMovieToEpisode(int id, int episodeId, [FromBody] MovieEpisodeDto movieEpisode)
        {
            movieEpisode.MovieId   = id;
            movieEpisode.EpisodeId = episodeId;
            if (!MovieLogic.MovieExists(id))
            {
                return(NotFound());
            }
            if (!PodcastLogic.PodcastExists(episodeId))
            {
                return(NotFound());
            }
            var returnMovie = await MovieLogic.AddMovieToEpisodeAsync(movieEpisode);

            return(CreatedAtAction("GetMovie", new { id = returnMovie.Id }, returnMovie));
        }