public async Task <IEnumerable <DailyForecastViewModel> > GetWeatherForecast(ForecastRequestData data) { var paramsData = Mapper.Map <WeatherParamsData>(data); IEnumerable <DailyWeatherForecastDTO> result; if (data.ProviderType == WeatherForecastProviderType.All) { result = await _weatherService.GetAverageWeatherForecastForPeriodByAllProviders(paramsData); } else { result = await _weatherService.GetWeatherForecastsForPeriod(paramsData, (WeatherProviderType)data.ProviderType); } return(Mapper.Map <IEnumerable <DailyForecastViewModel> >(result)); }