public async Task <ActionResult <CTaskType> > PostCTaskType(CTaskType cTaskType) { _context.CTaskType.Add(cTaskType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCTaskType", new { id = cTaskType.Id }, cTaskType)); }
public async Task <IActionResult> PutCTaskType(int id, CTaskType cTaskType) { if (id != cTaskType.Id) { return(BadRequest()); } _context.Entry(cTaskType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CTaskTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }