Пример #1
0
        public void Edit(
            int movieId,
            string title,
            string description,
            int?durationInMinutes,
            string trailerUrl,
            IEnumerable <int> selectedGenresIds,
            IEnumerable <int> genresIdsToRemove)
        {
            var movie = this.Context.Movies.Find(movieId);

            if (movie == null)
            {
                return;
            }

            movie.Title             = title;
            movie.Description       = description;
            movie.DurationInMinutes = durationInMinutes;
            movie.TrailerUrl        = trailerUrl;

            genreServices.UpdateMovieGenres(movieId, selectedGenresIds, genresIdsToRemove);

            this.Context.SaveChanges();
        }