protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) { if (!this._dispatchers.CancelableCommand.Executing(this._command, this._interceptionContext)) { return((DbDataReader) new InterceptableDbCommand.NullDataReader()); } DbCommandInterceptionContext interceptionContext = new DbCommandInterceptionContext(this._interceptionContext); if (behavior != CommandBehavior.Default) { interceptionContext = interceptionContext.WithCommandBehavior(behavior); } return(this._dispatchers.Command.Reader(this._command, interceptionContext)); }
protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) { if (!_dispatchers.CancelableCommand.Executing(_command, _interceptionContext)) { return(new NullDataReader()); } var interceptionContext = new DbCommandInterceptionContext(_interceptionContext); if (behavior != CommandBehavior.Default) { interceptionContext = interceptionContext.WithCommandBehavior(behavior); } return(_dispatchers.Command.Reader(_command, interceptionContext)); }
protected override Task <DbDataReader> ExecuteDbDataReaderAsync( CommandBehavior behavior, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (!this._dispatchers.CancelableCommand.Executing(this._command, this._interceptionContext)) { return(new Task <DbDataReader>((Func <DbDataReader>)(() => (DbDataReader) new InterceptableDbCommand.NullDataReader()))); } DbCommandInterceptionContext interceptionContext = new DbCommandInterceptionContext(this._interceptionContext); if (behavior != CommandBehavior.Default) { interceptionContext = interceptionContext.WithCommandBehavior(behavior); } return(this._dispatchers.Command.ReaderAsync(this._command, interceptionContext, cancellationToken)); }