public bool Book(Guid customerId, int quantity) { if (quantity > Quantity || bookingsByCustomerId.ContainsKey(customerId)) { return(false); } Quantity -= quantity; bookingsByCustomerId[customerId] = new RoomAvailabilityBooking(customerId, quantity); return(true); }
protected bool Equals(RoomAvailabilityBooking other) { return(CustomerId.Equals(other.CustomerId) && Quantity == other.Quantity); }