Esempio n. 1
0
 private void Initialize(DbConnection connection)
 {
     TransactionContext = _transactionContextFactory(connection);
     if (TransactionContext != null)
     {
         TransactionContext.Configuration.LazyLoadingEnabled = false;
         TransactionContext.Configuration.AutoDetectChangesEnabled = false;
     }
 }
 private void Initialize(DbConnection connection)
 {
     var currentInfo = DbContextInfo.CurrentInfo;
     DbContextInfo.CurrentInfo = null;
     try
     {
         TransactionContext = _transactionContextFactory(connection);
         if (TransactionContext != null)
         {
             TransactionContext.Configuration.LazyLoadingEnabled = false;
             TransactionContext.Configuration.AutoDetectChangesEnabled = false;
             TransactionContext.Database.Initialize(force: false);
         }
     }
     finally
     {
         DbContextInfo.CurrentInfo = currentInfo;
     }
 }