public async Task <ActionResult <MotorcyclePoint> > PostMotorcyclePoint(MotorcyclePoint motorcyclePoint) { _context.MotorcyclePoints.Add(motorcyclePoint); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMotorcyclePoint", new { id = motorcyclePoint.MotorcyclePointId }, motorcyclePoint)); }
public async Task <IActionResult> PutMotorcyclePoint(int id, MotorcyclePoint motorcyclePoint) { if (id != motorcyclePoint.MotorcyclePointId) { return(BadRequest()); } _context.Entry(motorcyclePoint).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MotorcyclePointExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }