Exemplo n.º 1
0
        public async Task <ActionResult <WinnerGame> > PostWinnerGame(WinnerGame winnerGame)
        {
            _context.WinnerGame.Add(winnerGame);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetWinnerGame", new { id = winnerGame.Id }, winnerGame));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutWinnerGame(Guid id, WinnerGame winnerGame)
        {
            if (id != winnerGame.Id)
            {
                return(BadRequest());
            }

            _context.Entry(winnerGame).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!WinnerGameExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }