public async Task <ActionResult <Caseworker> > PostCaseworker(Caseworker caseworker) { _context.Caseworkers.Add(caseworker); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCaseworker", new { id = caseworker.Id }, caseworker)); }
public async Task <IActionResult> PutCaseworker(int id, Caseworker caseworker) { if (id != caseworker.Id) { return(BadRequest()); } _context.Entry(caseworker).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CaseworkerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }