Esempio n. 1
0
        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));
        }