public async Task <IActionResult> RefreshCriticInfo() { var supportedYears = await _fantasyCriticService.GetSupportedYears(); var masterGames = await _fantasyCriticService.GetMasterGames(); foreach (var masterGame in masterGames) { if (!masterGame.OpenCriticID.HasValue) { continue; } if (masterGame.IsReleased(_clock) && masterGame.ReleaseDate.HasValue) { var year = masterGame.ReleaseDate.Value.Year; var supportedYear = supportedYears.Single(x => x.Year == year); if (supportedYear.Finished) { continue; } } var openCriticGame = await _openCriticService.GetOpenCriticGame(masterGame.OpenCriticID.Value); if (openCriticGame.HasValue) { await _fantasyCriticService.UpdateCriticStats(masterGame, openCriticGame.Value); } foreach (var subGame in masterGame.SubGames) { if (!subGame.OpenCriticID.HasValue) { continue; } var subGameOpenCriticGame = await _openCriticService.GetOpenCriticGame(subGame.OpenCriticID.Value); if (subGameOpenCriticGame.HasValue) { await _fantasyCriticService.UpdateCriticStats(subGame, subGameOpenCriticGame.Value); } } } return(Ok()); }