Dapper-NodaTime
Dapper-NodaTime copied to clipboard
Nullable types not supported
When retrieving a nullable type, say Instant?
, and the result from the database is actually null (System.DBNULL
), an exception is thrown with the message "Cannot convert System.DBNULL to NodaTime.Instant".
It seems that in order to support nullable types, a new set of type handlers has to be added. I've forked the problem and made a proposal, which seems to work. It hasn't, however, been tested yet (couldn't quite figure the test setup), so I haven't made a PR just yet.
It is possible to create a class with a nullable property and use that, but it seems excessive to have have to make a whole wrapper class just for a simple nullable value.
It is possible to create a class with a nullable property and use that, but it seems excessive to have have to make a whole wrapper class just for a simple nullable value.
Hi @lundmikkel , I think this library is no longer maintained. Were you able to fix your issue completely? I mean, is there any other working alternative, or you just resorted on yours?
@carlos0202 Must admit I haven't used this for a long time. I'm not sure how I ended solving this, since it was in a previous job, where I don't have access to the code any longer. Sorry.