public async Task <CityDto> GetCityByNameAsync(string name) { var city = await _citiesRepository.FindByNameAsync(name); if (city == null) { throw new ObjectNotFoundException($"City with id {name} does not exist"); } return(_mapper.Map <CityDto>(city)); }