예제 #1
0
        internal void ChangeSlotAgendaItem(EntityId id, AgendaItem agendaItemId)
        {
            var slot = _slots.FirstOrDefault(s => s.Id == id);

            if (slot is null)
            {
                throw new AgendaSlotNotFoundException(id);
            }

            if (slot is not RegularAgendaSlot regularAgendaSlot)
            {
                throw new InvalidAgendaSlotTypeException(id);
            }

            regularAgendaSlot.ChangeAgendaItem(agendaItemId);
            IncrementVersion();
        }
예제 #2
0
 public RegularAgendaSlot(EntityId id, DateTime from, DateTime to, AgendaItem agendaItem) : base(id, from, to)
     => AgendaItem = agendaItem;