/// <summary> /// Apply for tournament /// </summary> /// <param name="tournamentId">Tournament id</param> /// <returns>TournamentApply view</returns> public ActionResult ApplyForTournament(int tournamentId) { var tournament = _tournamentService.Get(tournamentId); if (tournament == null) { return(HttpNotFound()); } var noTournamentTeams = _tournamentService.GetAllNoTournamentTeams(tournamentId); var tournamentApplyViewModel = new TournamentApplyViewModel { Id = tournamentId, TournamentTitle = tournament.Name, Teams = noTournamentTeams.Select(TeamNameViewModel.Map) }; return(View(tournamentApplyViewModel)); }