Example #1
0
        public Schedule(PointInTime pointInTime)
        {
            Guard.Against.Null(() => pointInTime);

            if (pointInTime.IsBefore(DateTime.UtcNow))
            {
                throw new BusinessException("Cannot create a schedule for a point in time that occurs in the past.");
            }

            this.Apply(Map.ValueObject(pointInTime).ToEvent <ScheduleCreated>());
        }
Example #2
0
 private void Handle(ScheduleCreated @event)
 {
     this.PointInTime = Map.Event(@event).ToValueObject <PointInTime>();
 }