public async Task <IActionResult> PutErosterings(long id, Erosterings erosterings) { if (id != erosterings.ErosteringsId) { return(BadRequest()); } _context.Entry(erosterings).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ErosteringsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Erosterings> > PostErosterings(Erosterings erosterings) { _context.Erosterings.Add(erosterings); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (ErosteringsExists(erosterings.ErosteringsId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetErosterings", new { id = erosterings.ErosteringsId }, erosterings)); }