public async Task <ActionResult <tenuretype> > Posttenuretype(tenuretype tenuretype) { _context.tenuretype.Add(tenuretype); await _context.SaveChangesAsync(); return(CreatedAtAction("Gettenuretype", new { id = tenuretype.tenureTypeId }, tenuretype)); }
public async Task <IActionResult> PutTenureType(int id, tenuretype tenuretype) { if (id != tenuretype.tenureTypeId) { return(BadRequest()); } _context.Entry(tenuretype).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tenuretypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }