protected virtual void OnBeforeCommand(BeforeCommand e) { EventHandler <BeforeCommand> handler = BeforeCommand; if (handler != null) { handler(this, e); } }
private void HandleEvent(object sender, BeforeCommand e) { var events = _interceptors.OfType <IEventInterceptor <BeforeCommand> >().OrderBy(x => x.Priority); foreach (var eventInterceptor in events) { var result = eventInterceptor.Apply(_repository.DomainContext, e); if (!result.ContinueExecution) { break; } } }
protected virtual void OnBeforeCommand(BeforeCommand e) { BeforeCommand?.Invoke(this, e); }