Ejemplo n.º 1
0
        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)));
        }
Ejemplo n.º 2
0
 public void DeleteFlight(int id)
 {
     flightRepo.Delete(id);
 }