public async Task <ActionResult> AddAsync(CountryDto countryDto) { CountryModel country = _mapper.Map <CountryModel>(countryDto); await _countryService.AddAsync(country); return(Ok()); }
public async Task <ActionResult> UpdateAsync(CountryDto country) { CountryModel countryModel = _mapper.Map <CountryModel>(country); await _countryService.UpdateAsync(countryModel); return(Ok()); }
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)); }