Fix GridReader wiring: use IParameterCallbacks instead of DynamicParameters in QueryMultiple (sync + async)
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
IParameterCallbacksinstead ofDynamicParameters. -
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
DynamicParametersis unchanged. -
Custom implementations of
IParameterCallbacksnow work correctly.
Fixes #2179.
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.
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.