public TransactionWrapper(IRequestDataStorage requestDataStorage, SessionWrapperFactory sessionWrapperFactory)
        {
            this.requestDataStorage = requestDataStorage;

            sessionWrapper = sessionWrapperFactory.Create();

            parent = requestDataStorage.GetValue <TransactionWrapper>(CurrentTransactionContainerKey);
            requestDataStorage.SetValue(CurrentTransactionContainerKey, this);
        }
 public TResult Invoke <TResult>(Func <ISession, TResult> func)
 {
     using (var sessionWrapper = sessionWrapperFactory.Create())
         return(func(sessionWrapper.Session));
 }