public void CreateGenres(List <string> categories, int movieId) { foreach (var genre in categories) { int genreId; CreateIfNotExists(genre, out genreId); var genreMovieParams = new GenreMovieParams(); genreMovieParams.GenreId = genreId; genreMovieParams.MovieId = movieId; genreMovieParams.Status = Status.Active; genreMovieParams.UserType = UserTypes.Dashboard; _genreMovieService.CreateOrUpdate(genreMovieParams); } }
public void CreateGenresByIds(IEnumerable <int> genreIds, int movieId) { _genreMovieService.DeleteGenreMovies(movieId); foreach (var genreId in genreIds) { var genre = GetCulturedEntity(genreId); int genreCreatedId; CreateIfNotExists(genre.Name, out genreCreatedId); var genreMovieParams = new GenreMovieParams(); genreMovieParams.GenreId = genreId; genreMovieParams.MovieId = movieId; genreMovieParams.Status = Status.Active; genreMovieParams.UserType = UserTypes.Dashboard; _genreMovieService.CreateOrUpdate(genreMovieParams); } }