public JsonResult DeleteTeamFromTournament(int teamId, int tournamentId) { JsonResult result = null; try { _tournamentService.DeleteTeamFromTournament(teamId, tournamentId); result = Json(new TeamDeleteFromTournamentViewModel { Message = ViewModelResources.TeamWasDeletedSuccessfully, HasDeleted = true }); } catch (MissingEntityException ex) { result = Json(new TeamDeleteFromTournamentViewModel { Message = ex.Message, HasDeleted = false }); } return(result); }