Exemplo n.º 1
0
 public static Album From(AlbumJson json)
 {
     if (json != null)
     {
         return(new Album()
         {
             AlbumId = json.AlbumId,
             GenreId = json.GenreId,
             ArtistId = json.ArtistId,
             Title = json.Title,
             Price = json.Price,
             AlbumArtUrl = json.AlbumArtUrl,
             Created = json.Created,
             OrderCount = json.OrderCount,
             Artist = Artist.From(json.Artist),
             Genre = Genre.From(json.Genre)
         });
     }
     else
     {
         return(new Album()
         {
             AlbumId = 0,
             Title = "Unknown",
         });
     }
 }
Exemplo n.º 2
0
        public static List <Genre> From(List <GenreJson> genres)
        {
            List <Genre> results = new List <Genre>();

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

            foreach (GenreJson g in genres)
            {
                results.Add(Genre.From(g));
            }
            return(results);
        }