shollygami / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

Impossible to map Nullable<bool> from Oracle DB. #163

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I have a small I try to map a field from Oracle Database. 

The field is define as Number(1,0) nullable. 
I expected a mapping from dapper to a nullable<bool> in c# .. seems logic to me 
as Dapper is mapping a Number(1,0) to a bool. 

I have an error from dapper: 

---
Error parsing column 14 (<%FIELD%> =0 - Int16)

Invalid cast from 'System.Int16' to 'System.Nullable`1[[System.Boolean, 
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.
----

 Any solution about that problem ? 

Original issue reported on code.google.com by Frederic...@gmail.com on 8 Nov 2013 at 10:09

GoogleCodeExporter commented 8 years ago
Short term, no - you'd have to read it as that type. Longer term: there are 
already a number of mappings applied - if that is one that is common/needed, I 
suspect that we can add in code to handle it.

Original comment by marc.gravell on 8 Nov 2013 at 10:11

GoogleCodeExporter commented 8 years ago
Please handle it!

Original comment by RCallagh...@googlemail.com on 1 Apr 2014 at 10:33

GoogleCodeExporter commented 8 years ago
Fixed now, I believe (recent code, not nuget)

Original comment by marc.gravell on 6 Aug 2014 at 3:32