Dapper
Dapper copied to clipboard
Fix #2028
This fixes issue #2028 that occurs when executing ExecuteAsync on a CommandDefinition with Pipelined command flag in combination with multiple parameters on the Microsoft.Data.SqlClient and with MultipleActiveRecordSets set to true.
I simply applied the fix proposed in the issue and added a test to ensure that the issue is not occuring.
As far as I understand, the original version runs ExecuteNonQueryAsync on a DbCommand but disposes this command before awaiting the result ExecuteNonQueryAsync. With this fix this behavior is turned around. However, I am not sure how this affects other drivers, or why this issue did not occur with the System.Data.SqlClientdriver.