Inheritance: IUnitOfWork
Example #1
0
 /// <summary>
 /// Unregisters the unit of work.
 /// </summary>
 /// <param name="unitOfWork">The unit of work.</param>
 internal static void UnregisterUnitOfWork(UnitOfWork unitOfWork)
 {
     var stack = CurrentStack;
     if (stack.TopUnitOfWork == unitOfWork)
     {
         if (stack.TopTransaction != null)
         {
             throw new SessionException("Transaction is open! Try commit or rollback before ");
         }
         ClearStackInfo(stack);
     }
 }
Example #2
0
 /// <summary>
 /// Registers the unit of work.
 /// </summary>
 /// <param name="unitOfWork">The unit of work.</param>
 internal static void RegisterUnitOfWork(UnitOfWork unitOfWork)
 {
     var stack = CurrentStack;
     // if no session yet, start new
     if (stack.Session == null)
     {
         stack.TopUnitOfWork = unitOfWork;
         stack.Session = (DocumentSession)DocumentStoreInstance.OpenSession();
     }
 }