public async Task <IActionResult> PutPP_TaskStatuses([FromRoute] int id, [FromBody] PP_TaskStatuses pP_TaskStatuses) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pP_TaskStatuses.TaskStatusID) { return(BadRequest()); } _context.Entry(pP_TaskStatuses).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PP_TaskStatusesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostPP_TaskStatuses([FromBody] PP_TaskStatuses pP_TaskStatuses) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.TaskStatuses.Add(pP_TaskStatuses); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPP_TaskStatuses", new { id = pP_TaskStatuses.TaskStatusID }, pP_TaskStatuses)); }