Esempio n. 1
0
        public async Task GetCovidInfo(string country)
        {
            Console.WriteLine(country);
            var covidInfo = await _service.GetCovidInfo(country);

            await Clients.All.SendAsync("ReceiveCovidInfo", covidInfo);
        }
        public async Task <JsonResult> GetCountryToday(string country)
        {
            var covidInfo = await _service.GetCovidInfo(country);

            if (covidInfo == null)
            {
                return(new JsonResult(new object()));
            }
            return(new JsonResult(covidInfo));
        }