public async Task ReportForecast() { var httpResponse = await AttemptToReportForecastViaHttp(); var jsonResponse = await httpResponse.GetJsonAsync <ForecastCreationResultDto>(); _driverContext.SaveAsLastForecastReportResult(jsonResponse); }
public async Task ReportForecast() { var forecastDto = new WeatherForecastDto( _tenantId, _userId, Any.DateTime(), Any.Integer(), Any.String()); using var httpResponse = await _httpClient .Request("WeatherForecast") .PostJsonAsync(forecastDto); var jsonResponse = await httpResponse.GetJsonAsync <ForecastCreationResultDto>(); _driverContext.SaveAsLastReportedForecast(forecastDto); _driverContext.SaveAsLastForecastReportResult(jsonResponse); }