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;
                }
            }
        }
Exemple #3
0
 protected virtual void OnBeforeCommand(BeforeCommand e)
 {
     BeforeCommand?.Invoke(this, e);
 }