public async Task <IHttpActionResult> CreateAsync(CountryDto country) { _repository.Add(country.Map <Country>()); await _unitOfWork.CompleteAsync(); return(Created(new Uri(Request.RequestUri + "/" + country.Id), country)); }
public async Task <IHttpActionResult> UpdateAsync(int id, CountryDto country) { var countryInDb = await _repository.GetAsync(id); if (countryInDb == null) { return(NotFound()); } _repository.Add(country.Map <Country>()); await _unitOfWork.CompleteAsync(); return(Ok()); }