コード例 #1
0
        public static ArtistDTO ToLongDTO(Artist artist)
        {
            if (artist == null)
            {
                return(null);
            }

            return(new ArtistDTO()
            {
                Id = artist.Id,
                Name = artist.Name,
                UrlPicture = artist.UrlPicture,
                Albums = artist.Albums.Select(a => AlbumCoreConverter.ToLongDTO(a)).ToList()
            });
        }
コード例 #2
0
        public static SongDTO ToLongDTO(Song song)
        {
            if (song == null)
            {
                return(null);
            }

            return(new SongDTO()
            {
                Id = song.Id,
                Name = song.Name,
                Year = song.Year,
                Album = AlbumCoreConverter.ToShortDTO(song.Album),
                Artist = ArtistCoreConverter.ToShortDTO(song.Album.Artist),
                Url = song.Url
            });
        }