public async Task <ActionResult <Flight> > DeleteFlightAsync(int id) { var flight = await _repository.GetByIdAsync(id); if (flight == null) { return(NotFound()); } _repository.Delete(flight); await _repository.SaveChangesAsync(); return(Ok(_mapper.Map <FlightReadDto>(flight))); }
public void DeleteFlight(int id) { flightRepo.Delete(id); }