private Guid?VerifyOrAddCity(string city, string country) { var cityId = _addressService.GetCityByName(city); if (cityId == null) { cityId = _addressService.AddCity(city, country); if (cityId == null) { throw new ArgumentException(string.Format("the city {0} hasn't been added to database", city)); } } return(cityId); }
public IActionResult PostCity(CityDto city) { var result = addressService.AddCity(city); return(Created("", result)); }