Exemple #1
0
            public override async Task <Unit> Handle
            (
                FetchWeatherForecastsAction aFetchWeatherForecastsAction,
                CancellationToken aCancellationToken
            )
            {
                var getWeatherForecastsRequest = new GetWeatherForecastsRequest {
                    Days = 10
                };

                GetWeatherForecastsResponse getWeatherForecastsResponse =
                    await WebApiService.GetResponse <GetWeatherForecastsResponse>(getWeatherForecastsRequest)
                    .ConfigureAwait(false);

                WeatherForecastsState._WeatherForecasts = getWeatherForecastsResponse.WeatherForecasts;
                return(Unit.Value);
            }
Exemple #2
0
            public override async Task <Unit> Handle
            (
                FetchWeatherForecastsAction aFetchWeatherForecastsAction,
                CancellationToken aCancellationToken
            )
            {
                var getWeatherForecastsRequest = new GetWeatherForecastsRequest {
                    Days = 10
                };

                GetWeatherForecastsResponse getWeatherForecastsResponse =
                    await HttpClient.GetFromJsonAsync <GetWeatherForecastsResponse>
                    (
                        getWeatherForecastsRequest.GetRoute(), aCancellationToken
                    )
                    .ConfigureAwait(false);

                WeatherForecastsState._WeatherForecasts = getWeatherForecastsResponse.WeatherForecasts;
                return(Unit.Value);
            }