public async Task <ActionResult <TasksHistory> > PostTasksHistory([FromBody] TasksHistory tasksHistory) { _context.TasksHistory.Add(tasksHistory); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTasksHistory", new { id = tasksHistory.Id }, tasksHistory)); }
public async Task <IActionResult> PutTasksHistory(int id, TasksHistory tasksHistory) { if (id != tasksHistory.Id) { return(BadRequest()); } _context.Entry(tasksHistory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TasksHistoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }