Ejemplo n.º 1
0
        public static List <GenreJson> From(List <Genre> genres)
        {
            List <GenreJson> results = new List <GenreJson>();

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

            foreach (Genre g in genres)
            {
                results.Add(GenreJson.From(g));
            }
            return(results);
        }
Ejemplo n.º 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);
        }