示例#1
0
        public static List <ArtistJson> From(List <Artist> artists)
        {
            List <ArtistJson> results = new List <ArtistJson>();

            if (artists == null)
            {
                return(results);
            }

            foreach (Artist a in artists)
            {
                results.Add(ArtistJson.From(a));
            }
            return(results);
        }
示例#2
0
        public static AlbumJson From(Album album)
        {
            var result = new AlbumJson()
            {
                AlbumId     = album.AlbumId,
                GenreId     = album.GenreId,
                ArtistId    = album.ArtistId,
                Title       = album.Title,
                Price       = album.Price,
                AlbumArtUrl = album.AlbumArtUrl,
                Created     = album.Created,
                OrderCount  = album.OrderCount,
                Artist      = ArtistJson.From(album.Artist),
                Genre       = GenreJson.From(album.Genre)
            };

            return(result);
        }