Пример #1
0
            private bool InitializeReader(DbContext _, bool result)
            {
                var relationalCommand = _relationalCommandCache.GetRelationalCommand(_relationalQueryContext.ParameterValues);

                _dataReader
                    = relationalCommand.ExecuteReader(
                          new RelationalCommandParameterObject(
                              _relationalQueryContext.Connection,
                              _relationalQueryContext.ParameterValues,
                              _relationalCommandCache.ReaderColumns,
                              _relationalQueryContext.Context,
                              _relationalQueryContext.CommandLogger));

                _resultCoordinator = new SingleQueryResultCoordinator();

                _relationalQueryContext.InitializeStateManager(_standAloneStateManager);

                return(result);
            }
Пример #2
0
            private bool InitializeReader(DbContext _, bool result)
            {
                EntityFrameworkEventSource.Log.QueryExecuting();

                var relationalCommand = _relationalCommandCache.GetRelationalCommand(_relationalQueryContext.ParameterValues);

                _dataReader = relationalCommand.ExecuteReader(
                    new RelationalCommandParameterObject(
                        _relationalQueryContext.Connection,
                        _relationalQueryContext.ParameterValues,
                        _relationalCommandCache.ReaderColumns,
                        _relationalQueryContext.Context,
                        _relationalQueryContext.CommandLogger,
                        _detailedErrorsEnabled));

                _resultCoordinator = new SingleQueryResultCoordinator();

                _relationalQueryContext.InitializeStateManager(_standAloneStateManager);

                return(result);
            }
Пример #3
0
            private async Task <bool> InitializeReaderAsync(DbContext _, bool result, CancellationToken cancellationToken)
            {
                var relationalCommand = _relationalCommandCache.GetRelationalCommand(_relationalQueryContext.ParameterValues);

                _dataReader
                    = await relationalCommand.ExecuteReaderAsync(
                          new RelationalCommandParameterObject(
                              _relationalQueryContext.Connection,
                              _relationalQueryContext.ParameterValues,
                              _relationalCommandCache.ReaderColumns,
                              _relationalQueryContext.Context,
                              _relationalQueryContext.CommandLogger),
                          cancellationToken)
                      .ConfigureAwait(false);

                _resultCoordinator = new SingleQueryResultCoordinator();

                _relationalQueryContext.InitializeStateManager(_standAloneStateManager);

                return(result);
            }