Ejemplo n.º 1
0
        public static ArtistJson From(Artist artist)
        {
            var result = new ArtistJson()
            {
                ArtistId = artist.ArtistId,
                Name     = artist.Name
            };

            return(result);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
 public static Artist From(ArtistJson artist)
 {
     if (artist != null)
     {
         return(new Artist()
         {
             ArtistId = artist.ArtistId,
             Name = artist.Name
         });
     }
     else
     {
         return(new Artist()
         {
             ArtistId = 0,
             Name = "Unknown"
         });
     }
 }