public IEnumerable <WeatherForecast> Get()
        {
            var demos = _demoRepo.GetDemos();

            Console.WriteLine(JsonConvert.SerializeObject(demos));
            Console.WriteLine($"config:{_configuration["consul_config"]}");
            //var aa= _configuration.GetValue<string>("MySettings:ApplicationName");
            //.GetSection("Data").GetSection("ConnectionString").Value;
            var rng = new Random();

            return(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());
        }
示例#2
0
 public Demo GetDemos()
 {
     return(_demoRepo.GetDemos());
 }
示例#3
0
 public List <Demo> GetDemos()
 {
     return(_demoRepo.GetDemos());
 }