public void Dispose() { if (IsBaseSession) { Session.Dispose(); } requestDataStorage.SetValue(CurrentSessionContainerKey, parent); }
public TransactionWrapper(IRequestDataStorage requestDataStorage, SessionWrapperFactory sessionWrapperFactory) { this.requestDataStorage = requestDataStorage; sessionWrapper = sessionWrapperFactory.Create(); parent = requestDataStorage.GetValue <TransactionWrapper>(CurrentTransactionContainerKey); requestDataStorage.SetValue(CurrentTransactionContainerKey, this); }
public SessionWrapper(IRequestDataStorage requestDataStorage, ISessionFactory sessionFactory) { this.requestDataStorage = requestDataStorage; parent = requestDataStorage.GetValue <SessionWrapper>(CurrentSessionContainerKey); requestDataStorage.SetValue(CurrentSessionContainerKey, this); Session = IsBaseSession ? sessionFactory.OpenSession() : parent.Session; }
public void Dispose() { if (IsBaseTransaction) { Transaction?.Dispose(); } sessionWrapper.Dispose(); requestDataStorage.SetValue(CurrentTransactionContainerKey, parent); }