Ejemplo n.º 1
0
 internal static ICollection<Movie> MapINewsCollectionToMovieModelCollection(ICollection<INewsDto> newss)
 {
     var result = new Collection<Movie>();
     foreach (var item in newss)
     {
         var news = new Movie
         {
             Description = item.Description,
             MovieId = item.MovieId,
             OriginalTitle = item.OriginalTitle,
             RussianTitle = item.RussianTitle,
             ReleaseDate = item.ReleaseDate ?? DateTime.Now,
             Runtime = item.Runtime ?? 0,
             PosterUrl = "http://st.kp.yandex.net/images/poster/" + item.PosterId + @".jpg",
             FullLink = item.Genres.FirstOrDefault()?.Name + @"/" + item.MovieId
         };
         foreach (var genre in item.Genres)
         {
             news.Genres.Add(genre.Name);
         }
         result.Add(news);
     }
     return result;
 }
Ejemplo n.º 2
0
 internal static Movie MapINewsToMovieModel(INewsDto news)
 {
     var movie = new Movie
     {
         Description = news.Description,
         MovieId = news.MovieId,
         OriginalTitle = news.OriginalTitle,
         RussianTitle = news.RussianTitle,
         ReleaseDate = news.ReleaseDate ?? DateTime.Now,
         Runtime = news.Runtime ?? 0,
         PosterUrl = "http://st.kp.yandex.net/images/poster/" + news.PosterId + @".jpg",
         FullLink = news.Genres.FirstOrDefault()?.Name + @"/" + news.MovieId
     };
     foreach (var genre in news.Genres)
     {
         movie.Genres.Add(genre.Name);
     }
     return movie;
 }