public virtual bool RemoveCacheStore(string name) { object cacheStoreObj; if (!CacheStores.TryRemove(name, out cacheStoreObj)) { return(false); } IocManager.Release(cacheStoreObj); return(true); }
protected virtual void DisposeCaches() { foreach (var cache in Caches) { IocManager.Release(cache.Value); } }
protected override void DisposeCaches() { foreach (var cache in Caches) { _iocManager.Release(cache.Value); } }
private static void Test_Way_1(IIocManager iocManager) { var tester = iocManager.Resolve<Tester>(); tester.Test(); iocManager.Release(tester); }
/// <summary> /// 释放工作单元中的 DbContext、事务。 /// </summary> protected override void DisposeUnitOfWork() { _iocManager.Release(this); foreach (var activeDbContext in _activeDbContexts.Values) { activeDbContext.Dispose(); _iocManager.Release(activeDbContext); } _activeDbContexts.Clear(); if (_transactionScope != null) { _transactionScope.Dispose(); } }
private static void Test_Way_1(IIocManager iocManager) { var tester = iocManager.Resolve <Tester>(); tester.Test(); iocManager.Release(tester); }
public void Release(IMessageHandler handler) { if (disposedValue) { throw new ObjectDisposedException(nameof(_iocManager)); } _iocManager.Release(handler); }
public void Dispose() { foreach (var cache in Caches) { IocManager.Release(cache.Value); } Caches.Clear(); }
public override void Dispose() { if (_disposed) { return; } _disposed = true; if (_transaction != null) { _transaction.Dispose(); _transaction = null; } _activeDbContexts.Values.ForEach(dbContext => { dbContext.Dispose(); _iocManager.Release(dbContext); }); _activeDbContexts.Clear(); }
public override void ReleaseController(IController controller) { _iocManager.Release(controller); }
private void Release(IFileManagerServiceProvider service) { _iocManager.Release(service); }