public async Task <ActionResult <Tournooi> > PutTournooi(int id, Tournooi tournooi) { if (id != tournooi.TournooiID) { return(BadRequest()); } _context.Entry(tournooi).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TournooiExists(id)) { return(NotFound()); } else { throw; } } return(tournooi); }
public async Task <ActionResult <Tournooi> > PostTournooi(Tournooi tournooi) { _context.Tournooien.Add(tournooi); await _context.SaveChangesAsync(); return(Ok(tournooi)); }