private void DeleteFutureEvent(string futureEventId) { FutureEventScheduledEvent evt = FutureEvents.FirstOrDefault(e => e.Id == futureEventId); if (evt == null) { throw new ScheduledEventNotFoundException(futureEventId); } _futureEvents.Remove(evt); }
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); }
protected void Apply(FutureEventScheduledEvent e) { _futureEvents.Add(e); }