private void DisposeUnitOfWork(QuantumLogicUnitOfWork uow)
 {
     lock (_syncRoot)
     {
         ContextManager.DisposeContext();
         if (uow == _currentUow)
         {
             _currentUow = null;
         }
     }
 }
 public IQLUnitOfWork CurrentOrCreateNew(out bool newCreated, bool useTransaction = true)
 {
     lock (_syncRoot)
     {
         if (_currentUow == null)
         {
             newCreated  = true;
             _currentUow = new QuantumLogicUnitOfWork(ContextManager, useTransaction, DisposeUnitOfWork);
         }
         else
         {
             newCreated = false;
         }
         return(_currentUow);
     }
 }