// // GET: /StoreManager/Create public async Task <IActionResult> Create() { var genres = await MusicStoreService.GetGenresAsync(); var artists = await MusicStoreService.GetAllArtistsAsync(); ViewBag.GenreId = new SelectList(genres, "GenreId", "Name"); ViewBag.ArtistId = new SelectList(artists, "ArtistId", "Name"); return(View()); }
protected override async Task <List <Model.Genre> > RunAsync() { var genres = CheckCache(); if (genres != null) { _logger.LogInformation("Genres returning from cache!"); return(genres); } genres = await _storeService.GetGenresAsync(); CacheResults(genres); _logger.LogInformation("Genres returned from store!"); return(genres); }