public async Task <ActionResult <PilotSet> > PostPilotSet(PilotSet pilotSet) { _context.PilotSet.Add(pilotSet); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPilotSet", new { id = pilotSet.PersonId }, pilotSet)); }
public async Task <IActionResult> PutPilotSet(int id, PilotSet pilotSet) { if (id != pilotSet.PersonId) { return(BadRequest()); } _context.Entry(pilotSet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PilotSetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }