Пример #1
0
        public virtual bool AllowedFor(ISlotConfiguration context)
        {
            Ensure.That(context, nameof(context)).IsNotNull();

            var allSlots = context.GetAllSlots();

            return(allSlots.All(Slots.ContainsKey) && allSlots.Except(this.OccupiedSlots()).Any());
        }
Пример #2
0
        public virtual bool AllowedFor(ISlotConfiguration context)
        {
            if (context == null)
            {
                return(false);
            }

            var allSlots = new HashSet <string>(context.GetAllSlots());

            if (!allSlots.All(Slots.ContainsKey))
            {
                return(false);
            }

            return(!new HashSet <string>(this.OccupiedSlots()).Intersect(allSlots).Any());
        }