public async Task <ActionResult <Betesmodell> > PostBetesmodell(Betesmodell betesmodell) { _context.Beten.Add(betesmodell); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBetesmodell", new { id = betesmodell.Betenr }, betesmodell)); }
public async Task <IActionResult> PutBetesmodell(int id, Betesmodell betesmodell) { if (id != betesmodell.Betenr) { return(BadRequest()); } _context.Entry(betesmodell).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BetesmodellExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }