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(); }
public RegularAgendaSlot(EntityId id, DateTime from, DateTime to, AgendaItem agendaItem) : base(id, from, to) => AgendaItem = agendaItem;