public IActionResult GetInfoMatchesListView(string matchesList) { IEnumerable <IGrouping <string, Matches> > matchesGroup = GetMatchesFromJson(matchesList)?.GroupBy(x => x.MatchTypeName); MatchesModelView matchesModelView = new MatchesModelView() { CompetitionsList = GetCompetitionsList(matchesGroup), MatchesGroups = matchesGroup }; return(PartialView("~/Views/PartialViews/InfoMatchesPartialView.cshtml", matchesModelView)); }
public IActionResult MatchesList(string selectedCompetition) { IEnumerable<IGrouping<string, Matches>> matchesGroup = _matchesList?.GroupBy(x => x.MatchTypeName); selectedCompetition = string.IsNullOrWhiteSpace(selectedCompetition) ? matchesGroup?.FirstOrDefault()?.Key ?? string.Empty : selectedCompetition; var selectedMatchesGroup = matchesGroup?.Where(x => x.Key == selectedCompetition); MatchesModelView matchesModelView = new MatchesModelView() { SelectedCompetition = selectedCompetition?.Trim(), CompetitionsList = GetCompetitionsList(matchesGroup), MatchesGroups = selectedMatchesGroup }; return PartialView("~/Views/PartialViews/FixturesPartialView.cshtml", matchesModelView); }
public IActionResult GetMatchesListView(string selectedCompetition, string matchesList) { var allMatches = JsonConvert.DeserializeObject<List<Matches>>(matchesList); IEnumerable<IGrouping<string, Matches>> matchesGroup = GetFixtures(allMatches)?.GroupBy(x => x.MatchTypeName); selectedCompetition = string.IsNullOrWhiteSpace(selectedCompetition) ? matchesGroup?.FirstOrDefault()?.Key ?? string.Empty : selectedCompetition; var selectedMatchesGroup = matchesGroup?.Where(x => x.Key == selectedCompetition); MatchesModelView matchesModelView = new MatchesModelView() { SelectedCompetition = selectedCompetition?.Trim(), CompetitionsList = GetCompetitionsList(matchesGroup), MatchesGroups = selectedMatchesGroup }; return PartialView("~/Views/PartialViews/FixturesPartialView.cshtml", matchesModelView); }