Beispiel #1
0
        public async Task <ActionResult> AddAsync(CountryDto countryDto)
        {
            CountryModel country = _mapper.Map <CountryModel>(countryDto);

            await _countryService.AddAsync(country);

            return(Ok());
        }
Beispiel #2
0
        public async Task <ActionResult> UpdateAsync(CountryDto country)
        {
            CountryModel countryModel = _mapper.Map <CountryModel>(country);

            await _countryService.UpdateAsync(countryModel);

            return(Ok());
        }
Beispiel #3
0
        public async Task <ActionResult> GetAsync(int id)
        {
            CountryModel foundCountry = await _countryService.GetAsync(id);

            CountryDto foundCountryDto = _mapper.Map <CountryDto>(foundCountry);

            if (foundCountryDto == null)
            {
                return(NotFound());
            }

            return(Ok(foundCountryDto));
        }