示例#1
0
        public async Task <ActionResult> ListAlbums(string countryKey, string cityKey)
        {
            var city = await _travelService.GetCity(countryKey, cityKey);

            if (city == null || !city.Albums.Any())
            {
                return(NotFound());
            }

            if (city.Albums.Count() == 1)
            {
                return(RedirectToAction(
                           nameof(ListPhotos),
                           new
                {
                    countryKey = city.CountryKey,
                    cityKey = city.CityKey,
                    albumKey = city.Albums[0].Key,
                }));
            }

            SetTitle($"world traveler | {city.CountryName.ToLower()} | {city.CityName.ToLower()}");
            SetKeywords(city.CountryName, city.CityName);
            SetDescription($"Pictures of my time in {city.CityName}, {city.CountryName}. {city.Description}");

            var response = new ListAlbumsResponse(city);

            return(View(response));
        }