Пример #1
0
        public void RaiseScheduledEvent(string futureEventId, string futureEventOccuredEventId)
        {
            FutureEventScheduledEvent ev = FutureEvents.FirstOrDefault(e => e.Id == futureEventId);

            if (ev == null)
            {
                throw new ScheduledEventNotFoundException(futureEventId);
            }

            var futureEventOccuredEvent = new FutureEventOccuredEvent(futureEventOccuredEventId, futureEventId, Id);

            Emit(ev.Event);
            //wait for event apply in case of errors;
            Emit(futureEventOccuredEvent);
        }
Пример #2
0
 protected void Apply(FutureEventOccuredEvent e)
 {
     DeleteFutureEvent(e.FutureEventId);
 }