I have a application using nhibernate and fluent-nhibernate. We are using SQL Server 2008 and I have a table with a float column because we do not have a fixed precision and the user can set any number of decimal places (1, 10, 25 decimal places, etc..). I map it using fluent-nhibernate like this:
Map(x => x.Factor).Column("FACTOR").Not.Nullable();
And I also tried:
Map(x => x.Factor).Column("FACTOR").Precision(53).Not.Nullable();
and this:
Map(x => x.Factor).Column("FACTOR").CustomSqlType("float").Not.Nullable();
and it does not work. Look my database screenshot:
The field factor is my float column, the last registry have the number 1,234567891
and when the nhibernate hits a query on database, it comes in C# with 1,123456788
, the C# is rounding the value. We need the original value.
How can I get it working?