Skip to content

Dispose wrapped commands asynchronously - #2264

Open
alaricd wants to merge 2 commits into
DapperLib:mainfrom
pengdows:fix/issue-2185
Open

alaricd wants to merge 2 commits into
DapperLib:mainfrom
pengdows:fix/issue-2185

Conversation

@alaricd

@alaricd alaricd commented Oct 24, 2026

Copy link
Copy Markdown

Fixes #2185.

DbWrappedReader.DisposeAsync() previously disposed only the underlying reader, leaving the associated command undisposed when callers used await using with ExecuteReaderAsync. This adds async cleanup parity with synchronous disposal and a fakeDb regression test that verifies the command is disposed.

alaricd and others added 2 commits October 24, 2026 08:09
Mirror GridReader.DisposeAsync: await DbCommand.DisposeAsync, fall back to Dispose for other
IDbCommand implementations, and dispose the command even when reader disposal throws.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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