public Task <Response <IEnumerable <WeatherForecast> > > Handle(GetAllWeatherForecastsQuery request, CancellationToken cancellationToken) { var result = _dbContext.WeatherForecasts; _logger.LogInformation("Found {numberOfResults} results.", result.Count); return(Task.FromResult(ResponseFactory.Ok(result.AsEnumerable()))); }
public async Task <IEnumerable <WeatherForecast> > Get([FromQuery] GetAllWeatherForecastsQuery query) { await this._fileProcessingChannel.AddFileAsync(Guid.NewGuid().ToString()); return(await this._mediator.Send(query) .ConfigureAwait(false)); }
public async Task <IEnumerable <WeatherForecast> > Get([FromQuery] GetAllWeatherForecastsQuery query) { var forecasts = await this._mediator.Send(query) .ConfigureAwait(false); foreach (var weatherForecast in forecasts) { this._sendMessageService.SendMessage(weatherForecast); } this._sendMessageService.SendMessage(new WeatherForecastList { Entities = forecasts }); return(forecasts); }
public Task <List <WeatherForecast> > Handle(GetAllWeatherForecastsQuery request, CancellationToken cancellationToken) { return(Task.FromResult(WeatherForecastDatabase.Instance)); }