Exemple #1
0
                public ValueTask DisposeAsync()
                {
                    _dataReader?.Dispose();
                    _dataReader = null;
                    _relationalQueryContext.Connection.Close();

                    return(default);
            public void Dispose()
            {
                if (!_disposed)
                {
                    try
                    {
                        _relationalQueryContext.Connection.Semaphore.Wait();

                        if (_dataReader != null)
                        {
                            _dataReader.Dispose();
                            _dataReader   = null;
                            _dbDataReader = null;
                            _buffer       = null;

                            _relationalQueryContext.Connection?.Close();
                        }

                        _relationalQueryContext.Connection?.UnregisterBufferable(this);

                        _disposed = true;
                    }
                    finally
                    {
                        _relationalQueryContext.Connection.Semaphore.Release();
                    }
                }
            }
            public void Dispose()
            {
                _dataReader?.Dispose();
                foreach (var dataReader in _resultCoordinator.DataReaders)
                {
                    dataReader?.DataReader.Dispose();
                }
                _resultCoordinator.DataReaders.Clear();

                _dataReader = null;
            }
Exemple #4
0
            public void Dispose()
            {
                if (!_disposed)
                {
                    _dataReader?.Dispose();
                    _queryingEnumerable._relationalQueryContext.DeregisterValueBufferCursor(this);
                    _queryingEnumerable._relationalQueryContext.Connection?.Close();

                    _disposed = true;
                }
            }
        public IList <T> SqlQuery <T>(DbContext context, string sql, params object[] parameters) where T : class
        {
            var concurrencyDetector = context.Database.GetService <IConcurrencyDetector>();

            using (concurrencyDetector.EnterCriticalSection())
            {
                var rawSqlCommand          = context.Database.GetService <IRawSqlCommandBuilder>().Build(sql, parameters);
                RelationalDataReader query = rawSqlCommand.RelationalCommand.ExecuteReader(context.Database.GetService <IRelationalConnection>(), parameterValues: rawSqlCommand.ParameterValues);
                var list = ListHelper.DataReaderToList <T>(query.DbDataReader);
                query.Dispose();
                return(list);
            }
        }
            public void Dispose()
            {
                if (!_disposed)
                {
                    if (_dataReader != null)
                    {
                        _dataReader.Dispose();
                        _dataReader   = null;
                        _dbDataReader = null;
                        _buffer       = null;

                        _relationalQueryContext.Connection?.Close();
                    }

                    _disposed = true;
                }
            }
 public void Dispose()
 {
     _dataReader?.Dispose();
     _dataReader = null;
 }
Exemple #8
0
 public void Dispose()
 {
     _dataReader?.Dispose();
     _dataReader = null;
     _relationalQueryContext.Connection.Close();
 }
 public override void Dispose() => _relationalDataReader.Dispose();
                public ValueTask DisposeAsync()
                {
                    _dataReader?.Dispose();
                    _dataReader = null;

                    return(default);
 public void Dispose()
 {
     _dataReader.Dispose();
 }
 public override void Dispose() => _dataReader.Dispose();