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(FutureEventOccuredEvent e) { DeleteFutureEvent(e.FutureEventId); }