Example #1
0
        private void saveReservation(Reservation reservation)
        {
            //using (var txScope = new TransactionScope())
            {
                var hotelRes = new libHotelReservations.Models.HotelReservation();
                hotelRes.DepartureDate = reservation.Hotel.DepartureDate;
                hotelRes.ArrivalDate = reservation.Hotel.ArrivalDate;
                hotelRes.HotelId = reservation.Hotel.HotelId;
                hotels.book(hotelRes);

                var flightRes = new libFlightReservations.Models.FlightReservation();
                flightRes.DepartureDate = reservation.Flight.DepartureDate;
                flightRes.ArrivalDate = reservation.Flight.ArrivalDate;
                flightRes.FlightId = reservation.Flight.FlightId;
                flights.book(flightRes);
            }
        }
 void IHotelReservationsApi.book(HotelReservation reservation)
 {
         db.HotelReservations.Add(reservation);
         db.SaveChanges();
     
 }