Search code examples
dapper

Dapper can't map bit columns to boolean fields


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?


Solution

  • I found the problem. The stored procedure was using coalesce on the column which was casting it as an int.