protected override void DisposeUow() { if (Options.IsTransactional == true) { _transactionStrategy.Dispose(IocResolver); } else { foreach (var activeDbContext in GetAllActiveDbContexts()) { Release(activeDbContext); } } ActiveDbContexts.Clear(); }
/// <summary> /// uow完成后自动释放 /// </summary> protected override void DisposeUow() { //DbContext.Dispose(); if (null == Options) { return; } if (Options.IsTransactional == true) { foreach (var dbContext in DbContexts) { IocResolver.Release(dbContext); } DbContexts.Clear(); if (CurrentTransaction != null) { CurrentTransaction.Dispose(); CurrentTransaction = null; } } else { foreach (var activeDbContext in ActiveDbContexts.Values.ToImmutableList()) { Release(activeDbContext); } } if (CurrentTransaction != null) { CurrentTransaction.Dispose(); CurrentTransaction = null; } ActiveDbContexts.Clear(); }
protected override void DisposeUnit() { _efTransactionStrategy.Dispose(IocResolve); ActiveDbContexts.Clear(); }