public async Task <ActionResult <Tournee> > PostTournee(Tournee tournee) { _context.Tournee.Add(tournee); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTournee", new { id = tournee.TourneeId }, tournee)); }
public async Task <IActionResult> PutTournee(int id, Tournee tournee) { if (id != tournee.TourneeId) { return(BadRequest()); } _context.Entry(tournee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TourneeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }