Closed davemcmanus closed 5 years ago
I figured out the issue. I was using "IDbConnection" instead of "DbConnection". Perhaps the source should be updated to not throw exceptions on IDbConnection.
Hi @davemcmanus, the IDbConnection
interface exposes IDbCommand
which itself has no async methods at all (see https://docs.microsoft.com/en-us/dotnet/api/system.data.idbcommand?view=netframework-4.7.2 and https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbcommand?view=netframework-4.7.2).
The async versions are only present on the DbCommand
class exposed by the DbConnection
. Even when you use IDbConnection
Dapper internally downcast it to a DbConnection therefore it would give you an exception anyway on that side.
Hi @davemcmanus, the
IDbConnection
interface exposesIDbCommand
which itself has no async methods at all (see https://docs.microsoft.com/en-us/dotnet/api/system.data.idbcommand?view=netframework-4.7.2 and https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbcommand?view=netframework-4.7.2).The async versions are only present on the
DbCommand
class exposed by theDbConnection
. Even when you useIDbConnection
Dapper internally downcast it to a DbConnection therefore it would give you an exception anyway on that side.
@UnoSD Thanks for your reply. Makes sense.
The following code causes a SystemNotSupportedException:
Not sure what is causing the issue. Any suggestions?