public void HandleSequencedEvent(SequencedEvent sequencedEvent, bool?runImmediately = true) { if (!sequencedEvent.HasEvent()) { return; } IDispatcherEventPublisher publisher = null; _transactor.ApplyTransactionForLambda(() => FinallyGuarded.Apply(() => { publisher = DispatcherEventPublisher(sequencedEvent, runImmediately); AuditLogStatus(sequencedEvent); }, () => { if (publisher != null) { _container.Release(publisher); } })); }
public static void PublishDynamic(this IDispatcherEventPublisher publisher, IEvent @event, long seq = -1) { var publish = publisher.GetType().GetMethod("Publish").MakeGenericMethod(@event.GetType()); publish.Invoke(publisher, new object[] { @event, seq, true }); }
public Repository(IEventStore eventStore, IDispatcherEventPublisher publisher) { _eventStore = eventStore; _publisher = publisher; }