src/Shared/EntityFramework/Core/Objects/ObjectResult`.cs
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Data.Entity.Core.Objects.ObjectResult`1" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release managed and unmanaged resources; false to release only unmanaged resources.</param>
Releases the unmanaged resources used by the  and optionally releases the managed resources.
Releases the unmanaged resources used by the and optionally releases the managed resources .
protected override void Dispose(bool disposing)
        {
            var reader = _reader;
            _reader = null;
            _nextResultGenerator = null;
            if (reader != null && _readerOwned)
            {
                reader.Dispose();
                if (_onReaderDispose != null)
                {
                    _onReaderDispose(this, new EventArgs());
                    _onReaderDispose = null;
                }
            }
            if (_shaper != null)
            {
                if (_shaper.Context != null
                    && _readerOwned
                    && _shouldReleaseConnection)
                {
                    _shaper.Context.ReleaseConnection();
                }
                _shaper = null;
            }
            if (_command != null)
            {
                _command.Dispose();
                _command = null;
            }
        }
protected override void Dispose ( bool disposing ) { var reader = _reader ; _reader = null ; _nextResultGenerator = null ; if ( reader != null && _readerOwned ) { reader . Dispose ( ) ; if ( _onReaderDispose != null ) { _onReaderDispose ( this , new EventArgs ( ) ) ; _onReaderDispose = null ; } } if ( _shaper != null ) { if ( _shaper . Context != null && _readerOwned && _shouldReleaseConnection ) { _shaper . Context . ReleaseConnection ( ) ; } _shaper = null ; } if ( _command != null ) { _command . Dispose ( ) ; _command = null ; } }
Releases the unmanaged resources used by the  and optionally releases the managed resources.
Releases the unmanaged resources used by the and optionally releases the managed resources .
// This case includes when the ObjectResult is disposed before it  // created an ObjectQueryEnumeration; at this time, the connection can be released
disposing
bool
true to release managed and unmanaged resources; false to release only unmanaged resources.
true to release managed and unmanaged resources ; false to release only unmanaged resources .