public GetBookingOrderResponse CancelBooking(string bookingId)
        {
            var validationResult = _cancelBookingValidator.ValidateRequest(bookingId);

            if (!validationResult.PassedValidation)
            {
                throw new ArgumentException(validationResult.Errors.First());
            }

            var result = _context.Order.FirstOrDefault(x => x.Id == new Guid(bookingId));

            if (result != null)
            {
                _context.Order.Remove(result);
                _context.SaveChanges();
                return(new GetBookingOrderResponse
                {
                    Id = result.Id,
                    StartTime = result.StartTime,
                    EndTime = result.EndTime,
                    PatientId = result.PatientId,
                    DoctorId = result.DoctorId,
                    SurgeryType = result.SurgeryType
                });
            }

            return(null);
        }
        public void CancelBooking(Guid bookingId)
        {
            var validationResult = _cancelBookingValidator.ValidateRequest(bookingId);

            if (!validationResult.PassedValidation)
            {
                throw new ArgumentException(validationResult.Errors.First());
            }
            var booking = _context.Order.Single(o => o.Id == bookingId);

            _context.Order.Update(booking).Entity.Status = 1;
            _context.SaveChanges();
        }
        public void CancelBooking(CancelBookingRequest request)
        {
            var validationResult = _cancelbookingvalidator.ValidateRequest(request);

            if (!validationResult.PassedValidation)
            {
                throw new ArgumentException(validationResult.Errors.First());
            }

            var booking = _context.Order.Find(request.BookingId);

            booking.Status = OrderStatus.Canceled;
            _context.SaveChanges();
        }