I have a bit column in the SQL Server 2008 database and I am trying to use Dapper to map it to my object that has boolean fields that match the bit columns. I get invalid cast exceptions as Dapper is trying to say the columns are ints. How do I get it to map a bit to a bool? Also, will there ever be decent documentation for this ORM?
I found the problem. The stored procedure was using coalesce on the column which was casting it as an int.
Is the column nullable ? If this is the case try to structure the dto with a property of type bool?
instead of just bool
, to handle the DbNull value correctly. The better documentation is the code itself and the project home.