public IEnumerable <WeatherForecast> Get() { var rng = new Random(); var results = Enumerable.Range(1, 5).Select(index => new WeatherForecast { Date = DateTime.Now.AddDays(index), TemperatureC = rng.Next(-20, 55), Summary = Summaries[rng.Next(Summaries.Length)] }) .ToArray(); var message = new Message <WeatherForecast>(results.First()); rabbitMQService.PublishAsync(message).Wait(); return(results); }