public async Task <IActionResult> PutCurrentPartie(int id, CurrentPartie currentPartie) { if (id != currentPartie.Id) { return(BadRequest()); } _context.Entry(currentPartie).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CurrentPartieExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Partie> > AddCurrentPartie(CurrentPartie currentPartie) { _context.CurrentPartie.Add(currentPartie); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPartie", new { id = currentPartie.Id }, currentPartie)); }