Dapper icon indicating copy to clipboard operation
Dapper copied to clipboard

Fix GridReader wiring: use IParameterCallbacks instead of DynamicParameters in QueryMultiple (sync + async)

Open NandanDevHub opened this issue 3 months ago • 2 comments

This change fixes an issue where QueryMultiple and QueryMultipleAsync only invoked OnCompleted when parameters were of type DynamicParameters. If a caller provided a custom parameter type that implemented IParameterCallbacks, the callbacks were ignored.

Changes Below:

  • Updated both sync and async code paths to cast command.bParameters to IParameterCallbacks instead of DynamicParameters.

  • Added unit tests to confirm that OnCompleted is now called for custom parameter objects in both sync and async scenarios.

What i found locally is :

  • Existing behavior with DynamicParameters is unchanged.

  • Custom implementations of IParameterCallbacks now work correctly.

Fixes #2179.

NandanDevHub avatar Sep 26 '25 20:09 NandanDevHub

I added another small commit to adjust the new tests, reason being that AppVeyor CI doesn’t have SQL Server available, so the first version of the tests failed there.

With this update, the tests still run and pass locally when a database is present, but they no-op cleanly in CI without causing failures.

NandanDevHub avatar Sep 26 '25 21:09 NandanDevHub

Hi, just checking in to see if there’s any feedback or change you’d like here. I had eariler checked locally with SQL Server the fix works for both sync and async paths, i would love to make any small changes if needed.

NandanDevHub avatar Oct 16 '25 22:10 NandanDevHub