We have a situation where we are using DevArt to generate POCOs from an Oracle database. The problem is that an Oracle NUMBER type is translated by DevArt to a CLR decimal type. Which means that when we use CreateTableIfNotExists against SQL Server the columns thus mapped are created as decimal instead of float which is the correct SQL Server mapping for an unqualified Oracle NUMBER type ([source][1])
Have you tried registering a TypeConverter for this? it sounds like you just want to change the column definition of Decimal types? e.g:
public class SqlServerDecimalConverterAsFloat : SqlServerDecimalConverter
{
public override string ColumnDefinition
{
get { return "FLOAT"; }
}
}
SqlServerDialect.Provider.RegisterConverter<Decimal>(
new SqlServerDecimalConverterAsFloat());
Is there a particular place where the converter needs to be registered? I have added and registered the converter as you indicated, however, the table is still being created with decimal types instead of floats (and the ColumnDefinition method is not being hit).
private void CreateDestinationTables(IDbConnection destination)
{
SqlServerDialect.Provider.RegisterConverter<decimal>(new SqlServerDecimalConverterAsFloat());
destination.CreateTableIfNotExists(TableTypes); //an array of Type
}