Пример #1
0
        private MovieDTO ToMovieDTO(MovieModel movieModel)
        {
            MovieDTO movieDTO = new MovieDTO(movieModel.MovieId, movieModel.Title, movieModel.Description, movieModel.ReleaseDate, movieModel.MediaId);

            foreach (var genre in movieModel.Genres)
            {
                movieDTO.Genres.Add(_genreLogic.ToGenreDTO(genre));
            }
            movieDTO.ImagePath = movieModel.ImagePath;
            return(movieDTO);
        }
Пример #2
0
 public SearchDTO ToSearchDTO(SearchModel searchModel)
 {
     return(new SearchDTO(_genreLogic.ToGenreDTO(searchModel.Genre), searchModel.ReleasedAfter, searchModel.ReleasedBefore, searchModel.SearchTerm, searchModel.SortBy));
 }