示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }