public async Task <PassangerToAirplane> InsertPassangerToAirplaneAsync(PassangerToAirplane request) { if (request == null) { throw new ArgumentNullException("request"); } await _context.PassangersToAirplane.AddAsync(request); await _context.SaveChangesAsync(); return(request); }
public async Task <PassangerToAirplane> ChangePassangerAsync(int id, int IdAirplane) { PassangerToAirplane passangerToAirplane = new PassangerToAirplane(); passangerToAirplane.IdAirplane = IdAirplane; _context.Entry(passangerToAirplane).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw; } return(passangerToAirplane); }
public async Task <PassangerToAirplane> InsertPassangerToAirplaneAsync(PassangerToAirplane request) { return(await _passangerRepository.InsertPassangerToAirplaneAsync(request)); }
public async Task <ActionResult <PassangerToAirplane> > InsertPassangerToAirplane(PassangerToAirplane request) { await _passangerService.InsertPassangerToAirplaneAsync(request); return(CreatedAtAction(nameof(FindPassangerToAirplanerAsync), new { id = request.Id }, request)); }