public IActionResult Index() { var viewModel = new AllMatchesViewModel() { Matches = _matchRepository.Matches(), Statuses = _matchRepository.Statuses() }; return(View(viewModel)); }
public IActionResult Details(int id) { var fixtureExists = this.fixturesService.FixtureExistsById(id); if (!fixtureExists) { var errorViewModel = new ErrorViewModel { ErrorMessage = ErrorMessages.FixtureDoesNotExistsErrorMessage }; return(this.View(viewName: GlobalConstants.ErrorViewName, model: errorViewModel)); } var matches = this.matchesService.MatchesByFixture <MatchDetailsViewModel>(id).ToList(); var matchesViewModel = new AllMatchesViewModel { Matches = matches }; return(this.View(matchesViewModel)); }