Skip to content

fix: dispose command when DbWrappedReader.DisposeAsync is called#2206

Open
wyf027 wants to merge 1 commit into
DapperLib:mainfrom
wyf027:fix/dbwrappedreader-dispose-async-2185
Open

fix: dispose command when DbWrappedReader.DisposeAsync is called#2206
wyf027 wants to merge 1 commit into
DapperLib:mainfrom
wyf027:fix/dbwrappedreader-dispose-async-2185

Conversation

@wyf027

@wyf027 wyf027 commented May 17, 2026

Copy link
Copy Markdown

Summary

  • DbWrappedReader.DisposeAsync now disposes the wrapped IDbCommand after the reader, matching synchronous Dispose behavior.

Motivation

Fixes #2185async using with ExecuteReaderAsync left the command undisposed because only the reader was disposed asynchronously.

Test plan

  • DbWrappedReader_DisposeAsync_DisposesCommand unit test added
  • dotnet test tests/Dapper.Tests/Dapper.Tests.csproj --filter WrappedReaderTests

Mirror synchronous Dispose behavior so async using with
ExecuteReaderAsync releases the underlying IDbCommand.

Fixes DapperLib#2185
@wyf027

wyf027 commented Jun 8, 2026

Copy link
Copy Markdown
Author

I checked the current PR state. There are no review comments on this PR. The only failing status is the external AppVeyor build; GitHub exposes it as a single AppVeyor failure, and the public AppVeyor API currently returns 404 for the linked build, so I cannot inspect a code-specific failure log from here. No code change made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command not disposed with async using and ExecuteReaderAsync

1 participant