Esempio n. 1
0
 /// <summary>
 /// Creates the persistence context.
 /// </summary>
 /// <param name="newPersistenceContext">if set to <c>true</c> [new persistence context].</param>
 /// <returns></returns>
 public static PersistenceContext CreatePersistenceContext(bool newPersistenceContext)
 {
     if (newPersistenceContext || !PersistenceContextStack.Any())
     {
         PersistenceContextStack.Push(new PersistenceContext(newPersistenceContext));
     }
     PersistenceContextStack.Peek().Register();
     return(PersistenceContextStack.Peek());
 }
Esempio n. 2
0
 public static void ForceDispose()
 {
     PersistenceContextStack.Peek().ForceDispose();
 }