protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { context.Dispose(); } } disposed = true; }
private bool disposedValue = false; // To detect redundant calls // This code added to correctly implement the disposable pattern. protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { db.Dispose(); } disposedValue = true; } }
public void Dispose() { _context.Dispose(); }