public async Task <ActionResult <CTaskPriority> > PostCTaskPriority(CTaskPriority cTaskPriority) { _context.CTaskPriority.Add(cTaskPriority); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCTaskPriority", new { id = cTaskPriority.Id }, cTaskPriority)); }
public async Task <IActionResult> PutCTaskPriority(int id, CTaskPriority cTaskPriority) { if (id != cTaskPriority.Id) { return(BadRequest()); } _context.Entry(cTaskPriority).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CTaskPriorityExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }