コード例 #1
0
        public async Task <ActionResult <TemperatureViewModel> > Get(int cityId)
        {
            var temperatureDto = await _temperatureService.GetTemperatureByCityId(cityId);

            var temperatureViewModel = TemperaratureMappers.FromTemperatureDtoToTemperatureViewModel(temperatureDto);

            if (temperatureDto == null)
            {
                return(NotFound());
            }

            return(temperatureViewModel);
        }