We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using the generic Add<TDbConnection> overload of DbSettingMapper:
Add<TDbConnection>
DbSettingMapper
DbSettingMapper.Add<MyDbConnection>(dbSettings, true); class MyDbConnection : DbConnection ...
Exception Message:
RepoDb.Exceptions.InvalidTypeException: 'Type must be a subclass of 'System.Data.Common.DbConnection'.'
The method is using StaticType.DbConnection instead of typeof(TDbConnection), so then the Guard check fails because: DbConnection is not a subclass of DbConnection.
StaticType.DbConnection
typeof(TDbConnection)
Guard
DbConnection
Workaround: Use the non-generic overload:
DbSettingMapper.Add(typeof(DbConnectionHolder), dbSettings, true);
RepoDb v1.12.6 and RepoDb.MySql v1.1.3
The text was updated successfully, but these errors were encountered:
mikependon
Successfully merging a pull request may close this issue.
Bug Description
I'm using the generic
Add<TDbConnection>
overload ofDbSettingMapper
:Exception Message:
The problem:
The method is using
StaticType.DbConnection
instead oftypeof(TDbConnection)
, so then theGuard
check fails because:DbConnection
is not a subclass ofDbConnection
.Workaround:
Use the non-generic overload:
Library Version:
RepoDb v1.12.6 and RepoDb.MySql v1.1.3
The text was updated successfully, but these errors were encountered: