I have a couple of fields in the database designated as floats.
In the mapping config file they get defined as follows:
<Column Id="Field1" CSType="System.Double?" PropertyName="Field1" FieldName="Field1" FriendlyName="Field1" IncludeInOutput="true" />
<Column Id="Field2" CSType="System.Double?" PropertyName="Field2" FieldName="Field2" FriendlyName="Field2" IncludeInOutput="true" />
However when the code gets generated they are casting as Decimal and the property is a decimal as well
entity.Field1= reader.IsDBNull(reader.GetOrdinal("Field1")) ? null : (System.Decimal?)reader["Field1"];
at this point I get the error "Specified cast is not valid."
So how come the entity is using a decimal when it should probably be using a System.Double?