public async Task <ActionResult <BetGame> > PostBetGame(BetGame betGame) { _context.BetGame.Add(betGame); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBetGame", new { id = betGame.Id }, betGame)); }
public async Task <IActionResult> PutBetGame(Guid id, BetGame betGame) { if (id != betGame.Id) { return(BadRequest()); } _context.Entry(betGame).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BetGameExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }