public async Task UpdateFantasyPoints() { _logger.Info("Updating fantasy points"); var supportedYears = await _interLeagueService.GetSupportedYears(); var activeYears = supportedYears.Where(x => x.OpenForPlay && !x.Finished); foreach (var activeYear in activeYears) { var calculatedStats = await _fantasyCriticService.GetCalculatedStatsForYear(activeYear.Year); await _fantasyCriticRepo.UpdatePublisherGameCalculatedStats(calculatedStats.PublisherGameCalculatedStats); } var finishedYears = supportedYears.Where(x => x.Finished); foreach (var finishedYear in finishedYears) { var calculatedStats = await _fantasyCriticService.GetCalculatedStatsForYear(finishedYear.Year); await _fantasyCriticRepo.UpdateLeagueWinners(calculatedStats.WinningUsers); } _logger.Info("Done updating fantasy points"); _logger.Info("Updating royale fantasy points"); var supportedQuarters = await _royaleService.GetYearQuarters(); foreach (var supportedQuarter in supportedQuarters) { if (supportedQuarter.Finished || !supportedQuarter.OpenForPlay) { continue; } await _royaleService.UpdateFantasyPoints(supportedQuarter.YearQuarter); } _logger.Info("Done updating royale fantasy points"); }