Example of how InterpolatedSql will work if IDbConnection has Transaction?
Closed this issue · 5 comments
AsuraKev commented
Example of how InterpolatedSql will work if IDbConnection has Transaction?
AsuraKev commented
Hi there, sorry I have encountered an error saying BeginExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized
When my DbConnection goes BeginTransaction(), and it seems not like it :(. Any idea what its complaining?
thanks :)
Drizin commented
Please share a small example where the problem can be reproduced.
AsuraKev commented
Drizin commented
Yep, passing the transaction to the extension methods (preferably using named parameter to avoid calling the wrong overload) seems to be the correct way of using transactions in Dapper.
DapperLib/Dapper#713
AsuraKev commented
thanks for the link and the help! :)