예제 #1
0
        public void SetRating(string bookingRef, int rating)
        {
            var campId = _booking.Get(bookingRef).CampId;

            int[] ratings = _booking.SetAndGetRatings(bookingRef, rating);

            int roundedRating = (int)Math.Round(ratings.Average(), MidpointRounding.AwayFromZero);

            _camp.SetRating(roundedRating, campId);
        }
예제 #2
0
        public BookingEntity GetBooking(string bookingRef)
        {
            var booking = _booking.Get(bookingRef);

            if (booking == null)
            {
                return(null);
            }

            var bookingDetails = _bmapper.BookingToBookingEntity(booking);

            return(bookingDetails);
        }