// private readonly TransactionScope _transaction;

        public HandlingScope(IDiContainerAccessor containerAccessor, HandlerIdentity identity)
        {
            Identity             = identity;
            _containerAccessor   = containerAccessor;
            _contextAccessor     = _containerAccessor.GetInstance <IDbContextAccessor>();
            _handlingScopesStack = _containerAccessor.GetInstance <IHandlingScopesStack <HandlingScope> >();

            _parentScope = _handlingScopesStack.GetCurrentScope();
            _handlingScopesStack.EnterScope(this);

            // _transaction = new TransactionScope(TransactionScopeOption.Required,
            //      new TransactionOptions {IsolationLevel = IsolationLevel.Snapshot});
        }
 public IdentityAssertion(IHandlingScopesStack <HandlingScope> scopesStack, HandlerIdentity identityToCheck)
 {
     _scopeIdentities = scopesStack.Select(s => s.Identity).Reverse().ToArray();
     _identityToCheck = identityToCheck;
 }
 public IHandlingScope Enter(HandlerIdentity identity)
 {
     return(new HandlingScope(_containerAccessor, identity));
 }
 public IHandlingScopesAnalyzerIdentityAssertion Identity(HandlerIdentity identity)
 {
     return(new IdentityAssertion(_scopesStack, identity));
 }