public IEnumerable <TimeSlot> GetAvailableTimeSlot(DateTime startDate) { var date = startDate.Date; RoomDayReservation reservationsOndate; if (!this._reservations.TryGetValue(date, out reservationsOndate)) { reservationsOndate = new RoomDayReservation(date); } return(reservationsOndate.GetAvailableSlots()); }
public Result Reserver(User user, TimeSlot slot) { var date = slot.GetDate(); RoomDayReservation existingReservations; if (!this._reservations.TryGetValue(date, out existingReservations)) { existingReservations = new RoomDayReservation(date); this._reservations.Add(date, existingReservations); } return(existingReservations.Book(user, slot)); }