Esempio n. 1
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (!disposing)
            {
                return;
            }
            _disposed = true;

            _activationBlock.Dispose();
        }
        public IEnumerable <Action <IConsumeContext <TMessage> > > GetSaga <TMessage>(IConsumeContext <TMessage> context,
                                                                                      Guid sagaId, InstanceHandlerSelector <T, TMessage> selector, ISagaPolicy <T, TMessage> policy)
            where TMessage : class
        {
            return(_repository.GetSaga(context, sagaId, selector, policy)
                   .Select(consumer => (Action <IConsumeContext <TMessage> >)(x =>
            {
                IActivationBlock activationBlock = _kernel.BeginBlock();

                try
                {
                    consumer(x);
                }
                finally
                {
                    activationBlock.Dispose();
                }
            })));
        }
Esempio n. 3
0
 public void Dispose()
 {
     _block.Dispose();
 }