public async Task <ActionResult <TaskOnGoing> > PostTaskOnGoing(TaskOnGoing taskOnGoing) { _context.TaskOnGoing.Add(taskOnGoing); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTaskOnGoing", new { id = taskOnGoing.TaskOnGoingId }, taskOnGoing)); }
public async Task <IActionResult> PutTaskOnGoing(int id, TaskOnGoing taskOnGoing) { if (id != taskOnGoing.TaskOnGoingId) { return(BadRequest()); } _context.Entry(taskOnGoing).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TaskOnGoingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }