示例#1
0
        public void Add(Task task)
        {
            Guard.Against.Null(() => task);

            if (this.scheduledTasks.Contains(task))
            {
                throw new BusinessException("The specified task has already been scheduled.");
            }

            var @event = new ScheduleTaskAdded {
                PointInTimeEpochMinutes = this.PointInTime.EpochMinutes
            };

            Map.Entity(task).ToEvent(@event);

            this.Apply(@event);
        }
示例#2
0
 private void Handle(ScheduleTaskAdded @event)
 {
     this.scheduledTasks.Add(Map.Event(@event).ToEntity <Task>());
 }