protected override Task<DbDataReader> ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (!_dispatchers.CancelableCommand.Executing(_command, _interceptionContext)) { return new Task<DbDataReader>(() => new NullDataReader()); } var interceptionContext = new DbCommandInterceptionContext(_interceptionContext); if (behavior != CommandBehavior.Default) { interceptionContext = interceptionContext.WithCommandBehavior(behavior); } return _dispatchers.Command.ReaderAsync(_command, interceptionContext, cancellationToken); }
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); }