示例#1
0
        public async Task <TileRecord> GetTotalActiveCases()
        {
            var totalActiveCases = await ActiveCaseService.GetCummilativeCases();

            return(new TileRecord
            {
                Value = totalActiveCases.Where(x => x.District == District.State).OrderByDescending(x => x.Date).First().Count,
                Title = "Total Active Cases"
            });
        }
示例#2
0
        public async Task <TileRecord> GetRecoveryRate()
        {
            var activeCasesCummilative = await ActiveCaseService.GetCummilativeCases();

            var historicalCasesCummilative = await HistoryOfCasesService.GetCummilativeCases();

            var fatalCaseCummilative = await FatalCaseService.GetCummilativeCases();

            var totalConfirmedCases = historicalCasesCummilative.Where(x => x.District == District.State).OrderBy(x => x.Date).Last().Count;
            var totalActiveCases    = activeCasesCummilative.Where(x => x.District == District.State).OrderBy(x => x.Date).Last().Count;
            var totalFatalCases     = fatalCaseCummilative.Where(x => x.District == District.State).Max(x => x.Count);

            return(new TileRecord
            {
                Title = "Recovery %",
                Value = Math.Round(((double)(totalConfirmedCases - (totalFatalCases + totalActiveCases)) / (double)totalConfirmedCases) * 100, 2)
            });
        }