コード例 #1
0
        public async Task <IActionResult> GetCityForCountry(int countryId)
        {
            if (!await _countryRepository.CountryExistsAsync(countryId))
            {
                return(NotFound());
            }
            var cities = await _cityRepository.GetCityForCountryAsync(countryId);

            var cityVMList = _mapper.Map <IEnumerable <CityVM> >(cities);

            return(Ok(cityVMList));
        }