コード例 #1
0
        /// <summary>
        /// Maps a data transfer object to a business model.
        /// </summary>
        /// <param name="source">The DTO that is to be mapped to a business model.</param>
        public UpcomingMovie(DirectTorrent.Data.Yify.Models.UpcomingMovie source)
        {
            UpcomingMovie temp = null;
            AutoMapper.Mapper.CreateMap<Data.Yify.Models.UpcomingMovie, UpcomingMovie>();
            temp = AutoMapper.Mapper.Map<UpcomingMovie>(source);

            this.Title = temp.Title;
            this.Year = temp.Year;
            this.ImdbCode = temp.ImdbCode;
            this.MediumCoverImage = temp.MediumCoverImage;
            this.DateAdded = temp.DateAdded;
            this.DateAddedUnix = temp.DateAddedUnix;
        }
コード例 #2
0
 /// <summary>
 /// Maps a data transfer object to a business model.
 /// </summary>
 /// <param name="source">The DTO that is to be mapped to a business model.</param>
 public MovieDetails(DirectTorrent.Data.Yify.Models.MovieDetailsData source)
 {
     MovieDetails temp = null;
     AutoMapper.Mapper.CreateMap<Data.Yify.Models.Torrent, Torrent>();
     AutoMapper.Mapper.CreateMap<Data.Yify.Models.Actor, Actor>();
     AutoMapper.Mapper.CreateMap<Data.Yify.Models.Director, Director>();
     AutoMapper.Mapper.CreateMap<Data.Yify.Models.Images, Images>();
     AutoMapper.Mapper.CreateMap<Data.Yify.Models.MovieDetailsData, MovieDetails>();
     temp = AutoMapper.Mapper.Map<MovieDetails>(source);
     this.Id = temp.Id;
     this.Url = temp.Url;
     this.ImdbCode = temp.ImdbCode;
     this.Title = temp.Title;
     this.TitleLong = temp.TitleLong;
     this.Year = temp.Year;
     this.Rating = temp.Rating;
     this.Runtime = temp.Runtime;
     this.Genres = temp.Genres;
     this.Language = temp.Language;
     this.MpaRating = temp.MpaRating;
     this.DownloadCount = temp.DownloadCount;
     this.LikeCount = temp.LikeCount;
     this.RtCriticsScore = temp.RtCriticsScore;
     this.RtCriticsRating = temp.RtCriticsRating;
     this.RtAudienceScore = temp.RtAudienceScore;
     this.RtAudienceRating = temp.RtAudienceRating;
     this.DescriptionIntro = temp.DescriptionIntro;
     this.DescriptionFull = temp.DescriptionFull;
     this.YtTrailerCode = temp.YtTrailerCode;
     this.DateUploaded = temp.DateUploaded;
     this.DateUploadedUnix = temp.DateUploadedUnix;
     this.Images = temp.Images;
     this.Torrents = temp.Torrents;
     this.Directors = temp.Directors;
     this.Actors = temp.Actors;
 }