public async Task <ActionResult <CountModel> > GetTotal([FromQuery] string province) { var result = await _casesService.GetCumulative(); if (result == null) { return(Ok(new CountModel { CasesTotal = Int32.MinValue, Date = DateTime.Now })); } if (!string.IsNullOrWhiteSpace(province)) { return(Ok(new CountModel { CasesTotal = CumulativeUtility.GetTotalForProvince(result, province), Date = DateTime.Now })); } else { return(Ok(new CountModel { CasesTotal = CumulativeUtility.GetTotal(result), Date = result.Last().Date })); } }
public async Task <ActionResult <CountModel> > GetLatestUpdate() { var result = await _casesService.GetCumulative(); if (result == null) { return(Ok(new CountModel())); } return(CumulativeUtility.GetLatest(result)); }
public async Task <ActionResult <List <CountModel> > > GetAllPerDayAggregate([FromQuery] string province) { var result = await _casesService.GetCumulative(); if (string.IsNullOrWhiteSpace(province)) { return(Ok(CumulativeUtility.GetCumulative(result))); } else { return(Ok(CumulativeUtility.GetCumulativeForProvince(result, province))); } }