Exemplo n.º 1
0
        public IActionResult Earthquakes(int?hour, int?day)
        {
            Debug.WriteLine($"{hour}, {day}");
            EarthquakeAPI            quakeSource = new EarthquakeAPI("https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_hour.geojson");
            IEnumerable <Earthquake> quakes      = quakeSource.GetRecentEarthquakes();

            return(Json(quakes));
        }
Exemplo n.º 2
0
        public IActionResult GetDataSynchronous()
        {
            _logger.LogInformation("GetDataSynchronous");
            EarthquakeAPI            quakeSource = new EarthquakeAPI("https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson");
            IEnumerable <Earthquake> quakes      = quakeSource.GetRecentEarthquakes().OrderByDescending(e => e.Magnitude);
            BitcoinPriceIndex        bpi         = CoinDeskAPI.GetBPI();

            return(Json(new { earthquakes = quakes, bitcoinPrices = bpi }));
        }