public void Dispose() { if (!disposed) { context.Dispose(); disposed = true; } }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { // Free managed objects here. _dbContext.Dispose(); } // Free unmanaged objects here. disposed = true; }