Closed GoogleCodeExporter closed 8 years ago
Suggested solution:
Add the following code to the constructor of SqlMapper:
...
typeMap[typeof(DateTime)] = DbType.DateTime;
typeMap[typeof(DateTimeOffset)] = DbType.DateTimeOffset;
typeMap[typeof(TimeSpan)] = DbType.Time; <--- This one ...
...
...
typeMap[typeof(DateTime?)] = DbType.DateTime;
typeMap[typeof(DateTimeOffset?)] = DbType.DateTimeOffset;
typeMap[typeof(TimeSpan?)] = DbType.Time; <--- ... and this one.
...
That seems to have worked for me.
Original comment by emil.b...@gmail.com
on 6 Mar 2012 at 10:50
Any chance of getting this rolled into the build distributed from NuGet? I can
work around it, but it's a bit ugly all things considered.
Original comment by casper...@caspershouse.com
on 24 Jun 2012 at 7:39
Noted. I'll work through a few outstanding, probably tomorrow.
Original comment by marc.gravell
on 24 Jun 2012 at 7:52
Any chance of getting this into a NuGet build? I'm running into the same
problem when trying to work with time data types.
Original comment by asp...@gmail.com
on 16 May 2013 at 1:45
[deleted comment]
This has been fixed for a long time
Original comment by marc.gravell
on 5 Aug 2014 at 3:47
Original issue reported on code.google.com by
thu...@gmail.com
on 9 Nov 2011 at 4:48