public async Task <IActionResult> PutAirplaneSeatingModel(int id, AirplaneSeatingModel airplaneSeatingModel) { if (id != airplaneSeatingModel.AirplaneSeatingId) { return(BadRequest()); } _context.Entry(airplaneSeatingModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AirplaneSeatingModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <AirplaneSeatingModel> > PostAirplaneSeatingModel(AirplaneSeatingModel airplaneSeatingModel) { _context.AirplaneSeatings.Add(airplaneSeatingModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAirplaneSeatingModel", new { id = airplaneSeatingModel.AirplaneSeatingId }, airplaneSeatingModel)); }