public async Task <IActionResult> PutLehrer([FromRoute] int id, [FromBody] Lehrer lehrer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != lehrer.LehrerID) { return(BadRequest()); } _context.Entry(lehrer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LehrerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutNotenerhebung([FromRoute] int id, [FromBody] Notenerhebung notenerhebung) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != notenerhebung.NotenerhebungID) { return(BadRequest()); } _context.Entry(notenerhebung).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NotenerhebungExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }