public async Task RefreshData() { summary = await GameDataService.GetGameSummary(); FirstDay = summary.CurrentDay - 1; standings = await StandingsService.GetStandings(1, summary.CurrentYear, 1); playoffs = await PlayoffService.GetPlayoffSummary(2, summary.CurrentYear); if (Yesterday != null) { await Yesterday.RefreshData(); } if (Today != null) { await Today.RefreshData(); } if (Tomorrow != null) { await Tomorrow.RefreshData(); } StateHasChanged(); }
protected override void OnInitialized() { GameData = GameDataService.GetGameSummary().Result; var seasons = CompetitionService.GetCompetitionsByYear(GameData.CurrentYear).Result.Where(c => c.Type == CompetitionViewModel.SEASON_TYPE).ToList(); if (seasons.Count > 0) { StandingsModel = StandingsService.GetStandings(seasons[0].Id, 1).Result; } else { StandingsModel = null; } DropDownState.OnChange += StateHasChanged; }