コード例 #1
0
        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));
            }
        }
コード例 #2
0
ファイル: FlightController.cs プロジェクト: jhavikas84/ARF
        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));
            }
        }