public async Task <IActionResult> PutConsecutiveControl(int id, ConsecutiveControl consecutiveControl) { if (id != consecutiveControl.Id) { return(BadRequest()); } _context.Entry(consecutiveControl).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConsecutiveControlExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ConsecutiveControl> > PostConsecutiveControl(ConsecutiveControl consecutiveControl) { _context.ConsecutiveControls.Add(consecutiveControl); await _context.SaveChangesAsync(); return(CreatedAtAction("GetConsecutiveControl", new { id = consecutiveControl.Id }, consecutiveControl)); }