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