public async Task <IActionResult> PutTournamentGridType(int id, TournamentGridType tournamentGridType) { if (id != tournamentGridType.GridId) { return(BadRequest()); } _context.Entry(tournamentGridType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TournamentGridTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void InputData() { _tournament.StartTournament(); var tournamentMenuList = new List <MenuItem> { new MenuItem(PlayRound, " Play next round"), new MenuItem(ShowGrid, " Show tournament grid"), }; if (_tournament is SingleEliminationTournament) { tournamentMenuList.Add(new MenuItem(SelectOneSidedGrid, " Select one-sided type of grid")); tournamentMenuList.Add(new MenuItem(SelectDoubleSidedGrid, " Select double-sided type of grid")); _tournamentGridType = TournamentGridType.OneSided; } var tournamentMenu = new Menu(tournamentMenuList, "Playing tournament ..."); tournamentMenu.Start(); }
public async Task <ActionResult <TournamentGridType> > PostTournamentGridType(TournamentGridType tournamentGridType) { _context.TournamentGridTypes.Add(tournamentGridType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTournamentGridType", new { id = tournamentGridType.GridId }, tournamentGridType)); }
private void SelectDoubleSidedGrid() { _tournamentGridType = TournamentGridType.DoubleSided; }
private void SelectOneSidedGrid() { _tournamentGridType = TournamentGridType.OneSided; }