Пример #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_context != null)
         {
             _context.Dispose();
             _context = null;
         }
     }
 }
Пример #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         if (disposing)
         {
             _context.Dispose();
         }
     }
     disposed = true;
 }
Пример #3
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_context != null)
         {
             _context.Dispose();
             _context = null;
         }
     }
 }
Пример #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }
            if (_context == null)
            {
                return;
            }

            _context.Dispose();
            _context = null;
        }
Пример #5
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (_context != null)
                    {
                        _context.Dispose();
                        _context = null;
                    }
                }
                disposedValue = true;
            }
        }
Пример #6
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_context != null)
         {
             _context.Dispose();
             _context = null;
         }
         if (_cancellationTokenSource != null)
         {
             _cancellationTokenSource.Dispose();
             _cancellationTokenSource = null;
         }
     }
 }
Пример #7
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (context != null)
                    {
                        context.Dispose();
                    }
                    if (cancellationTokenSource != null)
                    {
                        cancellationTokenSource.Dispose();
                        cancellationTokenSource = null;
                    }
                }

                // TODO: free unmanaged resources (unmanaged objects) and override finalizer
                // TODO: set large fields to null
                disposedValue = true;
            }
        }
Пример #8
0
        // Protected implementation of Dispose pattern.
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                if (booksContext != null)
                {
                    booksContext.Dispose();
                    booksContext = null;
                }

                if (cancellationTokenSource != null)
                {
                    cancellationTokenSource.Dispose();
                    cancellationTokenSource = null;
                }
            }

            disposed = true;
        }
Пример #9
0
 public void Dispose()
 {
     _context?.Dispose();
 }
Пример #10
0
 public void Dispose()
 {
     _dbContext.Dispose();
 }
Пример #11
0
 public void Dispose()
 {
     _booksContext?.Dispose();
 }
Пример #12
0
 public void Dispose()
 {
     _data.Dispose();
 }