public async Task <IActionResult> PutEtrainPartSequence(short id, EtrainPartSequence etrainPartSequence) { if (id != etrainPartSequence.EtrainPartSequenceId) { return(BadRequest()); } _context.Entry(etrainPartSequence).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EtrainPartSequenceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EtrainPartSequence> > PostEtrainPartSequence(EtrainPartSequence etrainPartSequence) { _context.EtrainPartSequence.Add(etrainPartSequence); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EtrainPartSequenceExists(etrainPartSequence.EtrainPartSequenceId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEtrainPartSequence", new { id = etrainPartSequence.EtrainPartSequenceId }, etrainPartSequence)); }