public async Task <ActionResult <CgiShift> > PostCgiShift(CgiShift cgiShift) { _context.CgiShift.Add(cgiShift); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCgiShift), new { id = cgiShift.Id }, cgiShift)); }
public async Task <IActionResult> PutCgiShift(int id, CgiShift cgiShift) { if (id != cgiShift.Id) { return(BadRequest()); } _context.Entry(cgiShift).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CgiShiftExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }