public async Task <ActionResult <TaskOrders> > PostTaskOrders(TaskOrders taskOrders) { _context.TaskOrders.Add(taskOrders); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTaskOrders", new { id = taskOrders.TaskOrderId }, taskOrders)); }
public async Task <IActionResult> PutTaskOrders(int id, TaskOrders taskOrders) { if (id != taskOrders.TaskOrderId) { return(BadRequest()); } _context.Entry(taskOrders).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TaskOrdersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }