protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { _context.Dispose(); } } }
protected override void Dispose(bool disposing) { using (var ctx = new SalesDbContext()) { if (disposing) { ctx.Dispose(); } base.Dispose(disposing); } }
private void Dispose(bool dispose) { if (!_disposed) { if (dispose) { _context.Dispose(); _disposed = false; } } }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { if (dbContext != null) { dbContext.Dispose(); } } disposedValue = true; } }
public void Dispose() { // Discard any inserts since we didn't commit _transaction.Dispose(); _workDbContext.Dispose(); }