public async Task <ActionResult <AdjunctType> > PostAdjunctType(AdjunctType adjunctType) { _context.AdjunctType.Add(adjunctType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAdjunctType", new { id = adjunctType.AdjunctTypeId }, adjunctType)); }
public async Task <IActionResult> PutAdjunctType(int id, AdjunctType adjunctType) { if (id != adjunctType.AdjunctTypeId) { return(BadRequest()); } _context.Entry(adjunctType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdjunctTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }