public async Task <ActionResult <GanttDataDetails> > PostGanttDataDetails(GanttDataDetails ganttDataDetails) { _context.GanttData.Add(ganttDataDetails); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGanttDataDetails", new { id = ganttDataDetails.Id }, ganttDataDetails)); }
public async Task <IActionResult> PutGanttDataDetails(int id, GanttDataDetails ganttDataDetails) { if (id != ganttDataDetails.Id) { return(BadRequest()); } _context.Entry(ganttDataDetails).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GanttDataDetailsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }