/// <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()); }
public static void ForceDispose() { PersistenceContextStack.Peek().ForceDispose(); }