public void DisposeTest() { _productService = null; _unitOfWork = null; _productRepository = null; if (_dbEntities != null) { _dbEntities.Dispose(); } }
/// <summary> /// Protected Virtual Dispose method /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { Debug.WriteLine("UnitOfWork is being disposed"); _context.Dispose(); } } this.disposed = true; }