public async Task <ActionResult <SpeedWall> > PostSpeedWall(SpeedWall speedWall) { _context.SpeedWalls.Add(speedWall); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSpeedWall", new { id = speedWall.Id }, speedWall)); }
public async Task <IActionResult> PutSpeedWall(int id, SpeedWall speedWall) { if (id != speedWall.Id) { return(BadRequest()); } _context.Entry(speedWall).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpeedWallExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }