Beispiel #1
0
        public async Task DeleteCityAsync(int id)
        {
            var existingCity = await _citiesRepository.FindByIdAsync(id);

            if (existingCity == null)
            {
                throw new ObjectNotFoundException($"City with id {id} does not exist");
            }
            await _citiesRepository.DeleteAsync(id);
        }