Skip to content

Conversation

benrr101
Copy link
Contributor

Description

In this installment of merging SqlCommand, the focus is on the ExecuteXmlReader methods and supporting structures. As with previous PRs in this series, a new partial has been introduced for the Xml methods. Every commit is a bite-sized merge of a single method or so.

The following methods were merged:

  • BeginExecuteXmlReader
  • BeginExecuteXmlReaderAsync
  • BeginExecuteXmlReaderInternal
  • BeginExecuteXmlReaderInternalReadStage
  • CleanupAfterExecuteXmlReaderAsync
  • CompleteXmlReader
  • EndExecuteXmlReader
  • EndExecureXmlReaderAsync
  • EndExecuteXmlReaderInternal
  • ExecuteXmlReader
  • ExecuteXmlReaderAsync
  • InternalExecuteXmlReaderAsync
  • InternalExecuteXmlReaderWithRetryAsync

And also the ExecuteXmlReaderAsyncCallContext internal class

Issues

Continuation of work for #1261

Testing

Project still builds, CI should validate

@benrr101 benrr101 added this to the 7.0-preview2 milestone Sep 25, 2025
@benrr101 benrr101 requested a review from a team as a code owner September 25, 2025 18:13
@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 18:13
@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Sep 25, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR continues the SqlCommand code organization effort by consolidating ExecuteXmlReader-related methods from platform-specific files into a shared partial class. The refactoring extracts XML reader functionality from both .NET Framework and .NET Core implementations, moving them to a common location for better maintainability and reduced code duplication.

  • Consolidates ExecuteXmlReader methods into a shared partial class
  • Removes duplicated XML reader implementation from platform-specific files
  • Updates project files to include the new shared Xml partial class

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
SqlCommand.Xml.cs New shared partial class containing all ExecuteXmlReader methods and supporting structures
SqlCommand.NonQuery.cs Minor formatting improvements to callback parameter handling
SqlCommand.netfx.cs Removes ExecuteXmlReader methods and ExecuteXmlReaderAsyncCallContext class
SqlCommand.netcore.cs Removes ExecuteXmlReader methods and ExecuteXmlReaderAsyncCallContext class
Microsoft.Data.SqlClient.csproj (both) Adds reference to the new shared Xml partial class

CancellationTokenRegistration disposable,
Guid operationId)
{
base.Set(command,source, disposable);
Copy link
Preview

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after comma. Should be 'base.Set(command, source, disposable);'

Copilot uses AI. Check for mistakes.

Copy link

codecov bot commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 91.18644% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.28%. Comparing base (aa8bf73) to head (23d9633).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ent/src/Microsoft/Data/SqlClient/SqlCommand.Xml.cs 91.03% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3637      +/-   ##
==========================================
+ Coverage   65.17%   70.28%   +5.10%     
==========================================
  Files         277      272       -5     
  Lines       60592    60124     -468     
==========================================
+ Hits        39493    42256    +2763     
+ Misses      21099    17868    -3231     
Flag Coverage Δ
addons ?
netcore 73.83% <91.06%> (+5.71%) ⬆️
netfx 70.08% <88.50%> (+1.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common Project 🚮 Things that relate to the common project project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants