-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
Ciao!
I've reproduced the issue there:
So, if you have a postgresql db, and you use a jsonb column, and you use netwonsoft as deserializer such as:
NpgsqlConnection.GlobalTypeMapper.UseJsonNet(settings: settings);and perform a a query like
await conn.QueryFirstOrDefaultAsync<string>("select \"Content\" from public.\"Posts\"");will throw an exception with
---> System.InvalidCastException: Object must implement IConvertible.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Dapper.SqlMapper.GetValue[T](DbDataReader reader, Type effectiveType, Object val) in /_/Dapper/SqlMapper.cs:line 1366
--- End of inner exception stack trace ---
at Dapper.SqlMapper.ThrowDataException(Exception ex, Int32 index, IDataReader reader, Object value) in /_/Dapper/SqlMapper.cs:line 3928
at Dapper.SqlMapper.QueryRowAsync[T](IDbConnection cnn, Row row, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 496This happens only with 2.1.*, if I revert to 2.0.151 everything works perfectly.
This is probably the PR that breaks it.
ps: without json.net it also work perfectly, it's just a combination of json.net and jsonb.
Metadata
Metadata
Assignees
Labels
No labels