I'm using
- MS SQL Server 2008R2
- Fluent nHibernate 1.3
- nHibernate 3.2
I have a UInt64 field in my domain that potentially takes up the entire UInt64 range. Since MS-SQL doesn't support unsigned integers we decided to store it in a decimal(20,0) column (at least for now). I've tried using CustomSqlType("decimal(20, 0)") on that column in my mappings but I'm still getting an error when I try to access that field that says the database doesn't support UInt64.
How can I map a UInt64 field to a decimal(20, 0) column using Fluent nHibernate?
I've tried
- CustomSqlType("Decimal").Precision(20).Scale(0)
- CustomSqlType("decimal(20, 0)")
- CustomType() and the permutations of CustomSqlType and CustomType.
Edit The error it gives is "No mapping exists from DbType UInt64 to a known SqlDbType."
Edit 2 This works for the write side but breaks with an Invalid cast when values are read back out
.CustomSqlType("decimal").Precision(20).Scale(0)
.CustomType<NHibernate.Type.DoubleType>()