public async Task <bool> SaveBooking(BikeBookingViewModel model)
        {
            if (model != null)
            {
                var booking = new BicycleBooking
                {
                    RentalId         = model.RentalId,
                    RentedDate       = model.RentedDate,
                    BicycleInventory = await _context.BicycleInventories.FindAsync(model.SelectedBikeId),
                    Customer         = await _context.Customers.FindAsync(model.SelectedCustomerId)
                };

                _context.BicycleRentals.Add(booking);
                await _context.SaveChangesAsync();

                return(true);
            }

            return(false);
        }
        public async Task <bool> UpdateBooking(BikeBookingViewModel model)
        {
            if (model != null)
            {
                var booking = new BicycleBooking
                {
                    RentalId         = model.RentalId,
                    RentedDate       = model.RentedDate,
                    ReturnedDate     = model.ReturnedDate,
                    BicycleInventory = await _context.BicycleInventories.FindAsync(model.SelectedBikeId),
                    Customer         = await _context.Customers.FindAsync(model.SelectedCustomerId),
                    ModifiedBy       = model.ModifiedBy,
                    ModifiedDate     = model.ModifiedDate
                };
                var current = await _context.BicycleRentals.FindAsync(model.RentalId);

                _context.Entry(current).CurrentValues.SetValues(booking);
                await _context.SaveChangesAsync();

                return(true);
            }

            return(false);
        }