Example #1
0
        public async Task <ActionResult> GetCities(int countryId)
        {
            if (!await _countryRepository.CountriesExistAsync(countryId))
            {
                return(NotFound());
            }
            var cities = await _cityRepository.GetCitiesForCountryAsync(countryId);

            if (cities == null)
            {
                return(NotFound());
            }
            var citiesDto = _mapper.Map <IEnumerable <CityDto> >(cities);

            //var wrapper = new LinkCollectionResourceWrapper<CityDto>(citiesDto);
            //return Ok();
            return(Ok(citiesDto));
        }