コード例 #1
0
        private void DeleteFutureEvent(string futureEventId)
        {
            FutureEventScheduledEvent evt = FutureEvents.FirstOrDefault(e => e.Id == futureEventId);

            if (evt == null)
            {
                throw new ScheduledEventNotFoundException(futureEventId);
            }
            _futureEvents.Remove(evt);
        }
コード例 #2
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);
        }
コード例 #3
0
 protected void Apply(FutureEventScheduledEvent e)
 {
     _futureEvents.Add(e);
 }