Ejemplo n.º 1
0
 private static Album CreateAlbumFromDiscoveryItem(DiscoveryItem di)
 {
     var album = new Album()
     {
         Genre = di.Genre,
         SubGenre = di.SubGenre,
         IsExplicit = di.IsExplicit,
         Label = di.Label,
         Title = di.Title,
         Artist = di.Text,
         Duration = di.Duration,
         ImageUrl = di.ImageUrl,
         ItemId = di.ItemId,
         LongDescription = di.LongDescription,
         Rank = di.Rank,
         BingId = di.BingId
     };
     var releasedDate = Convert.ToDateTime(di.ReleaseDate);
     album.ReleasedYear = releasedDate.Year;
     return album;
 }
Ejemplo n.º 2
0
        private static Category CreateCategoryFromDiscoveryItem(DiscoveryItem di)
        {
            var category = new Category()
            {
                ActionTarget = di.ActionTarget,
                ImageId = di.ImageId,
                ImageUrl = di.ImageUrl,
                Rank = di.Rank,
                Text = di.Text,
                Title = di.Title,
            };
            category.Albums = new List<Album>();

            return category;
        }