public IHttpActionResult CreateBooking(BookingDTO booking) { try { var bookingId = _BookingService.CreateBooking(_UnitOfWork, _Mapper.GetMapper(), booking); if (bookingId > 0) { return(Ok(bookingId)); } else { return(BadRequest()); } } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult GetFlights() { try { var flights = _FlightService.GetFlights(_UnitOfWork, _Mapper.GetMapper()); if (flights?.Count > 0) { return(Ok(flights)); } else { return(NotFound()); } } catch (Exception ex) { return(InternalServerError(ex)); } }