public AppointmentsForDay(LocalDate date, AppointmentConfig config, List <AppointmentAggregate> slots) { PrevDateAvailable = config.AvailableIntervalStart == null || config.AvailableIntervalStart < date; NextDateAvailable = config.AvailableIntervalEnd == null || date < config.AvailableIntervalEnd; Date = date; AllSlots = slots.OrderBy(a => a.From).ToList(); if (((config.AvailableIntervalStart == null || config.AvailableIntervalStart <= date) && (config.AvailableIntervalEnd == null || date <= config.AvailableIntervalEnd))) { AvailableSlots = AllSlots.Where(a => a.CanCreateAppointment).ToList(); } else { AvailableSlots = new List <AppointmentAggregate>(); } }
public int GetItemCount(Item item) { return(AllSlots.Where(slot => slot.CurrentItem.Equals(item)).Sum(slot => slot.Items.Count)); }
private IEnumerable <InventorySlot> FindSlots(Item item) { return(AllSlots.Where(s => s.Item == item)); }